Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use the groups option to group together inputs. If each of the inputs has an error message, only one will be displayed. </p> <p>You'll probably want to override the messages associated with each of the fields, so they'll make more sense. For example, by default, you might get an error message like, "This Field is required." Well, that doesn't do the user alot of good when there are three inputs. You probably want to override the message to say "The Local Number is required." For this example, I just overrode all the error messages with "Please enter a valid Phone Number."</p> <pre><code>&lt;input type="text" name="countryCode" /&gt; &lt;input type="text" name="areaCode" /&gt; &lt;input type="text" name="localNumber" /&gt; groups: { phoneNumber: "countryCode areaCode localNumber" }, rules: { 'countryCode': { required: true, minlength:3, maxlength:3, number:true }, 'contactInformation[areaCode]': { required: true, minlength:3, maxlength:3, number:true }, 'contactInformation[localNumber]': { required: true, minlength:4, maxlength:4, number:true }, }, messages: { "countryCode": { required: "Please enter a valid Phone Number", minlength: "Please enter a valid Phone Number", maxlength: "Please enter a valid Phone Number", number: "Please enter a valid Phone Number" }, "areaCode": { required: "Please enter a valid Phone Number", minlength: "Please enter a valid Phone Number", maxlength: "Please enter a valid Phone Number", number: "Please enter a valid Phone Number" }, "localNumber": { required: "Please enter a valid Phone Number", minlength: "Please enter a valid Phone Number", maxlength: "Please enter a valid Phone Number", number: "Please enter a valid Phone Number" } }, </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload