These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:06 pm Advanced search

WebForms 2: can you set willValidate attribute?

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

WebForms 2: can you set willValidate attribute?

Postby FataL » Thu Apr 10, 2008 7:35 pm

Can I set willValidate attribute to false to prevent validation of form field or form itself?
Specification is not very clear enough about this:

P.S. Here is some tests for this issue.

Update: I found in specs that willValidate is read only. :roll:
But this is brings another question: how to remove validation from some form fields?
FataL
<h6>
 
Posts: 9
Joined: Thu Jun 28, 2007 7:02 pm

Postby anne » Tue Apr 15, 2008 9:43 pm

What is the use case?
User avatar
anne
<h4>
 
Posts: 32
Joined: Tue Feb 06, 2007 11:17 pm
Location: Utrecht, NL

Postby FataL » Fri Apr 25, 2008 5:38 pm

Real world example:
I have form with repetition template for members (name, e-mail, phone, etc.). Some fields in fieldset are required -- such name and e-mail.
By default there is only one empty fieldset for one member, but more can be added via "Add another member" template button.
Also, if user leaves all fields in member fieldset blank, there should be no required fields for completly empty fieldset.
FataL
<h6>
 
Posts: 9
Joined: Thu Jun 28, 2007 7:02 pm

Postby FataL » Fri Apr 25, 2008 8:24 pm

Another example from real world:
I have a form where some fields are required depends on what user entered in other fields, so under some circumstances some fields transforms from required to optional.
Code: Select all
Age: <input type=number name=age min=1><br>
If you are from 18 to 21 y.o.:<br>
Question 1: <input type=text name=q1 required>
Question 2: <input type=text name=q2>
<br>
If you are 22 and up:<br>
Question 1: <input type=text name=q1 required>
Question 2: <input type=text name=q2 required>
Question 3: <input type=text name=q2 required>
Last edited by FataL on Tue Apr 29, 2008 8:21 pm, edited 2 times in total.
FataL
<h6>
 
Posts: 9
Joined: Thu Jun 28, 2007 7:02 pm

Postby FataL » Tue Apr 29, 2008 8:15 pm

Third example (similar to previous one):
I have multiple options that implemented via radio buttons. When some options were choosen, they provide additional fields to fill out (required or optional).
I need a way to say to a browser to not validate all fields that not attached to selected option.
Code: Select all
<input type=radio name=a> Option 1<br>
Additional info: <input type=text name=aa required>

<input type=radio name=a> Option 2<br>
Additional info 1: <input type=text name=bb>
Additional info 2: <input type=text name=cc required>

<input type=radio name=a> Option 3<br>
Additional info 1: <input type=text name=dd required>
Additional info 1: <input type=text name=ee required>

<input type=radio name=a> Option 4
FataL
<h6>
 
Posts: 9
Joined: Thu Jun 28, 2007 7:02 pm

Postby zcorpan » Mon May 05, 2008 6:16 pm

Just set .required = false;
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest