Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery validate textarea:filled
    primarykey
    data
    text
    <p>i have the following form fields...</p> <pre><code>&lt;textarea name="anchors[]" id="anchors1" cols="45" rows="5" class="linkbox"&gt;&lt;/textarea&gt; &lt;textarea name="anchors[]" id="anchors2" cols="45" rows="5" class="linkbox"&gt;&lt;/textarea&gt; &lt;textarea name="urls[]" id="urls1" cols="45" rows="5" class="linkbox"&gt;&lt;/textarea&gt; &lt;textarea name="urls[]" id="urls2" cols="45" rows="5" class="linkbox"&gt;&lt;/textarea&gt; </code></pre> <p>which i'm trying to validate so that if say anchors2 is filled in, then urls2 must also be filled in, however i can't for the life of me get the following to work!...</p> <pre><code>var validator = $("#projectform").validate({ rules: { project_label: "required", keywords: "required", urls2: { required: "#anchors2:filled" } }, messages: { project_label: "Enter a project label", } ,errorElement: "div" ,submitHandler: function(form) { $('input[type=submit]').attr('value', 'Please wait'); $('input[type=submit]').attr('disabled', 'disabled'); this.form.onsubmit(); return false; } }); </code></pre> <p>When i click submit the project_label and keywords fields validate(or not) as would be expected, however i see nothing with regards to the anchors[] and urls[] fields. I have css set on the textarea.error to give a visual indiciation too but i don't see that either when attempting to validate.</p> <p>It should be noted that the following doesn't work either, which may shed some light?</p> <pre><code>urls1: "required", </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.
 

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