移动高级开发指南里,使用表格,数据筛选与分页,
.AddInput("startdate","开始日期","date") 日期输入框,点击确定后, 日期框内是空的,不能显示日期,
问题1. 选好日期,点击确定,怎么能让日期框里保留日期值。
问题2. 怎么用代码给这个日期输入框赋值? 尤其是在其他页面部分(case list.htm) 里面给这个日期输入框赋值,
问题3. 怎么能日期发生变化后,就进入list.htm的代码, 节省掉提交点击那个“确定”按钮
Dim wb
As New WeUI
Select
Case e.Path
Case
"filter.htm"
wb.AddForm("","form1","list.htm")
With wb.AddInputGroup("form1","ipg1","数据筛选")
.AddSelect("product","产品","|PD01|PD02|PD03|PD04|PD05")
.AddInput("startdate","开始日期","date")
.AddInput("enddate","结束时间","date")
End
With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End
With
Case
"list.htm"
问题2. 实际上就是在其他页面怎么引用日期输入框, 用什么语法?
怎么引用 test.htm 的 form1 的 wb.AddInputGroup 的日期输入框 .AddInput("xm"
Select
Case e.Path
Case
"test.htm"
Dim wb As New weui
wb.AddForm("","form1","test.htm")
With wb.AddInputGroup("form1","ipg1","时间输入")
.AddInput("xm","日期","date").Value =
Format(Date.Today,"yyyy-MM-dd")
With .AddInput("xm","时间","time")
.value = Format(Date.Now,"HH:mm")
.Min =
"08:00"
'输入的事件必须在8:00到12:00之间
.Max = "12:00"
End
With
With .AddInput("xm","日期时间","datetime-local")
.Value = Format(Date.Now,"yyyy-MM-ddTHH:mm") '留意一下这个格式,日期和时间之间用字母T隔开
.Readonly = True
End
With
End
With
With
wb.AddButtonGroup("form1","btg1",True)
.Add("btn1",
"确定",
"submit")
End
With
e.WriteString(wb.Build) '生成网页
End
Select
没有理解我的需求, 不是提交,
我在btn1点击提交后,执行today.htm, 需要把 日期输入框 .AddInput("startdate" 的日期值, 显示为date.today
我不会写这个语法, 怎么用代码把日期输入框的vlaue赋值
Dim wb5 As New WeUI
wb5.AddForm("", "form1", "list.htm")
With wb5.AddButtonGroup("form1", "btg2", False) '水平排列
.Add("btn1", "今日", "button", "today.htm")
.Add("btn2", "明日", "button", "tomorrow.htm")
.Add("btn3", "<", "submit").FormAction = "list.htm?btn=3"
.Add("btn4", ">", "button", "submit").Value = "btn4"
End With
'wb5.AddForm("", "form2", "list.htm")
With wb5.AddInputGroup("form1", "ipg1", "数据筛选")
.AddInput("startdate", "日期", "date").Value = e.PostValues("startdate")
End With
With wb5.AddButtonGroup("form1", "btg3", False) '水平排列
.Add("btn4", "确定", "submit")
End With
Select Case e.Path
Case "today.htm"
‘下面这句代码,是要把日期输入框赋值显示日期,怎么写语法? ’
怎么表述日期输入框。
wb5.AddInputGroup.AddInput("form1", "startdate").Value = date.today
[此贴子已经被作者于2025/1/10 10:43:04编辑过]
意思是说: 无法直接引用这个日期输入框?
非移动开发版,窗体里的控件,可以用 e.Form.Controls("DateTimePicker1")引用。
移动开发里,无法用代码引用 “日期输入框“ 并 赋值?
[此贴子已经被作者于2025/1/10 11:04:26编辑过]
网页是显示在用户的浏览器里的,而Foxtable代码是在后台服务器电脑里执行的。
直接改变网页控件值,只能在用户浏览器里执行js处理