2013-04-04, 20:27:02
(2012-09-04, 11:23:14)mdc.girmm Wrote: So... I still fighting with the problem of the checkbox validation. I don't want to bother you, but it's really important for me. I guess it's time to learn PHP...
I have tryed with this:
case 'radio':
if($this->value == "yes")
return True;
else return False;
I too am trying to add a required field to a form, but am having no luck at all.
I have added this to the form:
Code:
checkbox! "Acepto las condiciones de uso y aviso legal de esta web y su polÃÂtica de privacidad." "Acepto",
Which gives me an output of:
Code:
<div class="field checkbox">
<div class="label"><label for="p01-contact1_field4">Acepto las condiciones de uso y aviso legal de esta web y su política de privacidad. <strong style="color:red">*</strong></label></div>
<input id="p01-contact1_field4_option0" type="checkbox" name="p01-contact_fields[4][0]" value=" Acepto" /> Acepto</div>
And tried adding the following to p01-contact.php around line 871:
Code:
case 'checkbox':
if($_POST['p01-contact_fields'][4] == " Acepto")
return True;
else return False;
A red star shows up next to the field, but it allows the form to be sent regardless if it is checked or not.
Can anyone provide further assistance?