Is it possible to indicate which fields are mandatory
Is it possible to indicate which fields are mandatory
This question has an accepted answers - jump to answer
This discussion has been closed.
This question has an accepted answers - jump to answer
Answers
Hi pzh20,
It depens whether you want to achieve this client-side or server side.
If you want to do it client-side I'd suggest implementing the
preSubmit
which is fired just before the submit takes place. By returning false in this method you can prevent the submit from happening:If you want to implement this server-side I'd suggest you take a good close look at the examples provided in the reference documentation for using Validators in PHP and Validators in .NET.
@Allan, how do you link to the editor code references? Hmm, just purchased Editor, but I still can't link to references there :(
Hope this helps,
Thanks Alan, just what I needed.
Pete
@Ashbjorn - There is some documentation about this in tech note 8 - just replace the
dt-
prefix withe-
(for Editor).@pzh20 - There are a couple of other options for showing visually which fields are mandatory before the user submits invalid data:
field.className
to add a class that can be styled a particular wayfield.fieldInfo
to add text such as "This field is required"field.label
and just add something like<sup>*</sup>
.Allan
Actually, rethinking this, it still doesn't highlight the fields that are mandatory before being submitted. Is there no way to do what you might do with any input form and show the required fields?
Regards
Pete
I think we may have overlapped - see my comment above :-)
Allan