How to validate checkbox

Astrid 15 Apr, 2008
Searched the forum, but none of the found solutions are working.
Message: please select one appears, but when selected one option I'm unable to send. With validation on checkbox not activated forms sends o.k.

This is my error message:
$$.shared has no properties
getElements(["div.topbox", "div", "div", 2 more...], true)mootools.js.php (line 141)
getElement(["div.topbox div div div div"], undefined)mootools.js.php (line 143)
$ES("div.topbox div div div div", undefined)mootools.js.php (line 131)
e("div.topbox div div div", 0, 40)template.js.php (line 286)
setDivHeight()template.js.php (line 372)
start()template.js.php (line 334)
[Break on this error] A=A.trim().split(" "«»);for(var E=0,D=A.length;E<D;E++){var F=A[E];var G=F.match($...
GreyHead 16 Apr, 2008
Hi Astrid,

There was a chunk of code missing in the js file. See this post. Does this fix your problem?

Bob
Astrid 16 Apr, 2008
Hi Bob,
Downloaded latest version RC3 and the changes from the post you mentionned are already in moovalidation.js.

Now I don't get the message "please select", but can send form. So validation isn't working at all on checkboxes. No error messages anymore except for
_gat is not defined

This is my form:
<?php
global $my,$mosConfig_live_site;
// first we check if the user is logged
// if so, then we fill out some fields and set them to read only
$readonl="";
$in="";
$out="";
if ($my->id) {
$out=" SELECTED";
$readonl=" readonly='readonly'";
} else {
$in=" SELECTED";
}
?>
  
<table border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td> <label for="fromname">Mijn naam*: </label> </tc> 
    <td colspan="5"><input type="text" name="naam" id="naam" value="<?php echo $my->name?>"<?php echo $readonl?> /> 
    </td>
  <tr> 
    <td width="117"  >Mijn adres*:</td>
    <td colspan="4"><input name="adres" type="text" id="adres" value=""></td>
  </tr>
  <tr> 
    <td width="117"  ><p>Postcode*: </p></td>
    <td width="81"> <input name="postcode" type="text" id="postcode" value="" size="7" maxlength="7"> 
    </td>
    <td width="82">Plaats*:</td>
    <td colspan="2"> <input name="woonplaats" type="text" id="woonplaats" value=""></td>
  </tr>
  <tr> 
    <td width="117" >Telefoon*:</td>
    <td colspan="4"><input name="telefoon" type="text" id="telefoon" value=""></td>
  </tr>
  <tr> 
    <td width="117" >Mobiel:</td>
    <td colspan="4"><input name="mobiel" type="text" id="mobiel" value=""></td>
  </tr>
  <tr> 
    <td valign="top" >Ik heb:</td>
    <td colspan="4"> 
        <table width="394">
          <tr>
            <td width="386"><label>
              <input type="radio" name="ervaring" value="nooit">
              Nog nooit gegolfd, een paar keer ballen geslagen</label></td>
          </tr>
          <tr>
            <td><label>
              <input type="radio" name="ervaring" value="les">
              Les gehad</label></td>
          </tr>
          <tr>
            <td><label>
              <input type="radio" name="ervaring" value="baanpermissie">
              Baanpermissie</label></td>
          </tr>
          <tr>
            <td><label>
              <input type="radio" name="ervaring" value="gvb">
              GVB</label></td>
          </tr>
          <tr>
            <td><label>
              <input type="radio" name="ervaring" value="handicap">
              Handicap</label></td>
          </tr>
        </table>
</td>
  </tr>
  <tr> 
    <td >Mijn handicap is:</td>
    <td colspan="4"> <input name="hcp" type="text" size="4" maxlength="4"></td>
  </tr>
  <tr> 
    <td >Ik ben*:</td>
    <td colspan="4"> <input name="leeftijd" type="text" id="leeftijd" value="" size="2" maxlength="2">
      jaar </td>
  </tr>
  <tr> 
    <td valign="top">Ik wil meedoen met:</td>
    <td colspan="3" valign="top"> 
        <table width="200">
          <tr>
            <td><label>
              <input type="radio" name="meedoen" value="funfactory">
              Fun Factory</label></td>
          </tr>
          <tr>
            <td><label>
              <input type="radio" name="meedoen" value="Clinic">
              Clinic</label></td>
          </tr>
          <tr>
            <td><label>
              <input type="radio" name="meedoen" value="wedstrijd">
              9-holes wedstrijd</label></td>
          </tr>
        </table>
      </td>
    <td width="558"><ul>
        <li>Als je 12 jaar of jonger bent en je hebt baanpermissie, GVB of een 
          handicap, kan je kiezen of je mee wilt doen met de Fun Factory of met 
          de 9-holes wedstrijd.</li>
        <li>Als je 12 jaar of ouder bent en je hebt baanpermissie, GVB of een 
          handicap, kan je het beste kiezen voor de 9-holes wedstrijd.</li>
        <li>Als je ouder bent dan 12 jaar en je hebt nog nooit gegolfd, dan is 
          de Clinic voor jou het leukste.</li>
      </ul></td>
  </tr>
  <tr> 
    <td> <label for="email">E-mail*: </label></td>
    <td colspan="4"><input type="text" name="email" id="email" tabindex="511" value="<?php echo $my->email?>"<?php echo $readonl?> /> 
    </td>
  </tr>
  <tr> 
    <td valign="top" >Vraag/opmerking</td>
    <td colspan="4" valign="top"> <textarea name="vraag" id="vraag"></textarea></td>
  </tr>
  <tr> 
    <td colspan="5" >* Verplichte velden</td>
  </tr>
  <tr> 
    <td width="117" > </td>
    <td colspan="4"><input name="Verstuur" type="submit" id="Verstuur" value="Verstuur"> 
      <input name="Herstel" type="reset" id="Herstel" value="Herstel"> 
    </td>
  </tr>
</table>

Astrid 16 Apr, 2008
Sorry,
There is an error message:
$A(options).any is not a function
(no name)(false, input.required nooit)mooValidation.js (line 234)
test(false, input.required nooit)mooValidation.js (line 18)
test("validate-one-required", input.required nooit, false)mooValidation.js (line 84)
(no name)("validate-one-required"«»)mooValidation.js (line 76)
validate(input.required nooit, Object useTitle=false)mooValidation.js (line 75)
(no name)(input.required nooit)mooValidation.js (line 54)
validate()mooValidation.js (line 54)
onSubmit(submit )mooValidation.js (line 45)
F()mootools.js.php (line 45)
create(submit )mootools.js.php (line 46)
[Break on this error] return $A(options).any(function(elm) {
<br><br>Post edited by: Astrid, at: 2008/04/16 15:57
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger