Saturday 15 February 2014

javascript - Validation of a minimum of two input -


I'm looking for an input validation. Actually, I have 5 text fields but the first two have one condition Wanted: At least one must be completed.

Currently using validation I agree to jQuery, but it does not complete the function, would you have any idea?

thanks :)

citation op:

"One of at least two must be completed.

Currently validation of validation I agree to jQuery, but it does not satisfy this function, will you have Any ideas? "

wrong ... this does see this capability:

The included code is called requires_from_group . Use as follows:

1) Give each item in the group a normal class .

HTML :

  & lt; Input class = "productinfo" name = "partnumber" & gt; & Lt; Input class = "productinfo" name = "description" & gt;   

2) Define the following types of rules, where the first parameter is the required minimum number from the group and the second is the class you created above.

jQuery :

  $ (document) .ready (function () {$ ('# myform'). : {Partnumber: {Require_from_group: [1, 'Productinfo']}, Description: {require_from_group: [1, 'productinfo']}}, group: {mygroup: "partnumber description"}})}};   

Now, at least partnumber or description will be filled out.

3) Alternatively, to clean As the repetition of the error message, use it as follows, which will give an error message to the above two inputs.

  Groups: {mygroup: "partnumber description"}    

No comments:

Post a Comment