With wb.AddInputGroup("form1", "ipg3", "会议周期")
.AddSelect("hycf", "周期重复", "[否]|是")
.AddSelect("hyzq", "周期选择", "每天|[每周]|每月|每个工作日")
.AddInput("jzsj", "结束时间", "datetime-local").Value = Format(dt.AddYears(1), "yyyy-MM-ddTHH:mm")
End With
以上是现在的代码,我想实现默认只显示【周期重复】,只有【周期重复】选择【是】以后才显示【周期选择】和【结束时间】,要如何处理?
With .AddInput("kssj", "开始时间", "datetime-local")
.Value = Format(dt, "yyyy-MM-ddTHH:mm")
.Attribute = """
.Attribute = """
End With
选择的问题是开始时间修改以后我需要两个空间都触发,要如何处理?
.AddSelect("cxsj", "持续时间", "半小时|[1小时]|2小时|3小时|4小时")
以上代码为什么苹果手机打开会有一个空选项,如何去掉?
以下是引用YDS在2024/10/29 11:35:00的发言:
不行的,两个onchange只执行后面一个
肯定可以,不行只能说明没有用对
wb.AddForm("", "form1", "why.htm")
Dim dt As Date = Date.Now
With wb.AddInputGroup("form1", "ipg1", "会议信息")
.AddHiddenValue("uun", un)
Dim fz As Integer = VAL(dt.ToString("mm"))
If fz < 30 Then
dt = dt.AddMinutes(30 - fz)
Else
dt = dt.AddMinutes(60 - fz)
End If
With .AddInput("kssj", "开始时间", "datetime-local")
.Value = Format(dt, "yyyy-MM-ddTHH:mm")
.Attribute = """
End With
.AddSelect("cxsj", "持续时间", "半小时|[1小时]|2小时|3小时|4小时").Attribute = """
.AddHiddenValue("hygl", un)
With .AddInputCell("ic2")
.AddLabel("lry", "参会人员", 0)
.AddInput("ryzt", "", 1).Readonly = True
.AddVcodeButton("ryxz", "打开通信录", 2)
End With
With .AddTextArea("chry", 2)
.Readonly = True
.Placeholder = "请点击【打开通讯录】选人。"
.Attribute = ""
End With
.AddSelect("hydd", "会议地点", Functions.Execute("hysdd", dt.ToString("yyyy-MM-ddTHH:mm"), "1小时"))
.AddInput("hybt", "会议标题", "text")
End With
With wb.AddInputGroup("form1", "ipg2", "会议内容")
.AddTextArea("hynr", 3).Placeholder = "请在这里输入会议内容,最多500字!"
End With
js代码
// 定义函数,用于将输入框【kssj】、【cxsj】、【chry】的值以get方式传入网页并设置反馈值到【ryzt】
function sendValuesAndGetFeedback() {
// 获取输入框【kssj】、【cxsj】、【chry】的值
var kssjValue = document.getElementById('kssj').value;
var cxsjValue = document.getElementById('cxsj').value;
var chryValue = document.getElementById('chry').value;
// 构建URL,将输入框的值进行编码后拼接成get请求的参数
var url = 'getchry.htm?' +
'kssj=' + encodeURIComponent(kssjValue) +
'&cxsj=' + encodeURIComponent(cxsjValue) +
'&chry=' + encodeURIComponent(chryValue);
// 发送get请求获取反馈值
fetch(url)
.then(response => response.text())
.then(feedbackValue => {
// 设置反馈的值到输入框【ryzt】
document.getElementById('ryzt').value = feedbackValue;
});
};
function handleKssjChange() {
setAjaxOptions('hydd','gethydd.htm','kssj','cxsj',false);
sendValuesAndGetFeedback();
}
为什么输入框【kssj】、【cxsj】、【chry】的值改变以后都不会触发sendValuesAndGetFeedback()函数,只有通讯录选人后会触发sendValuesAndGetFeedback()函数,而且输入框【kssj】、【cxsj】改变后可以触发handleKssjChange()
[此贴子已经被作者于2024/10/29 17:27:23编辑过]