-
Required field
How do I make an input field required?
I wanted my dates to default to now() if not entered and I made the field definition in access use now() as default and this works great if I use a silent command to create the record, but creating the record with the add command and not entering the date does not have the same effect, I assume that when tornado builds the SQL command it puts 'nulls' in all fields not entered and that prevents access from defaulting to now(), I would be happy to just force the user to enter the date, but I cannot get the required field command to work.
Here is an example that does not work.
<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim i as integer
Dim G1 As New Tornado.Z()
with G1
.dbUnit = 1
.dbSkin = 3
.dbMode = "Grid"
.dbDSN = Application("Nwind")
.dbSQL = "Select * From Orders"
.dbGridDisplayFlds="0,1,2,3"
.dbeditaddflds = "fi=1|req=true,2,3"
.dbNavigationItem ="top,bottom,next,prev,reload,delete,add,search "
.dbbookmark = "orders;0"
.dbTextHolder = "Title=Test required field"
.ASPdbNet
end with
End Sub
</script>
-
tornado - edit - validate
Try this ->
Dim G1 As New Tornado.Z()
with G1
.dbUnit = 1
.dbSkin = 3
.dbMode = "Grid"
.dbDSN = "Nwind.mdb"
.dbSQL = "Select * From Orders"
.dbGridDisplayFlds="0,1,2,3"
.dbValidatorParams = "code=/tornado/Jars|Ent=false"
.dbeditaddflds = "fi=1|ty=TEXT|mask=NOTBLANK|req=true,2,3"
.dbNavigationItem ="top,bottom,next,prev,reload,delete,add,search "
.dbbookmark = "orders;0"
.dbTextHolder = "Title=Test required field"
.ASPdbNet
end with
FK
-
OK that works, now how do I make a date field required?
This won't work and now field 1 is not being recongnized as a required field.
<script language="vb" runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim i as integer
Dim G1 As New Tornado.Z()
with G1
.dbUnit = 1
.dbSkin = 3
.dbMode = "Grid"
.dbDSN = Application("Nwind")
.dbSQL = "Select * From Orders"
.dbGridDisplayFlds="0,1,2,3"
.dbValidatorParams = "code=/tornado/Jars|Ent=false"
.dbeditaddflds = "fi=1|ty=TEXT|mask=NOTBLANK|req=true,2,fi=3|ty=tex tcalendar|mask=NOTBLANK|req=true"
.dbNavigationItem ="top,bottom,next,prev,reload,delete,add,search "
.dbbookmark = "orders;0"
.dbTextHolder = "Title=Test required field"
.ASPdbNet
end with
End Sub
</script>
-
Validate can only be applied to TEXT and TEXTAREA and not TEXTCalendar. See whether you can use MagicValidate to do the validation part. Actually a quick JS will do the job also.
I bundled the two (MagicValidate and MagicCalendar) together and they seems to work. I have to do more testing to make it official. I'll send you a test copy.
FK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|