Validation errors showing on page load.
I'm using Form Builder (2.0.1) and have several fields which need to validated. When the page is loaded all of the validation error messages are displayed, even without any of the fields being made active.
This has only recently happened as I had been editing the form and the validation errors were working in the correct way.
The area which is displayed, but which should be hidden until validation is triggered is:
<span class="serverInvalidState" id="First_Name_ServerError">Please enter your first name</span>
If I change "false":
<?php
if (ValidatedField('getafreeremovalquote','getafreeremovalquote')) {
if ((strpos((",".ValidatedField("getafreeremovalquote","getafreeremovalquote").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
to "true":
<?php
if (ValidatedField('getafreeremovalquote','getafreeremovalquote')) {
if ((strpos((",".ValidatedField("getafreeremovalquote","getafreeremovalquote").","), "," . "1" . ",") !== true|| "1" == "")) {
if (!(true)) {
?>
Then it works as it should. I presume that some code elsewhere on the page is incorrect.
The script placed at teh bottom of the page is:
<script type="text/javascript">
<!--
var First_Name_Spry = new Spry.Widget.ValidationTextField("First_Name_Spry", "none",{validateOn:["blur"]});
var Last_Name_Spry = new Spry.Widget.ValidationTextField("Last_Name_Spry", "none",{validateOn:["blur"]});
var Email_Address_Spry = new Spry.Widget.ValidationTextField("Email_Address_Spry", "email",{validateOn:["blur"]});
var Phone_Number_Spry = new Spry.Widget.ValidationTextField("Phone_Number_Spry", "none",{validateOn:["blur"]});
var Delivery_County_Spry = new Spry.Widget.ValidationTextField("Delivery_County_Spry", "none",{validateOn:["blur"]});
var Move_Details_group_Move_Date_Spry = new Spry.Widget.ValidationTextField("Move_Details_group_Move_Date_Spry", "date", { format:'mm/dd/yyyy' , validateOn:["blur"]});
var Move_Details_group_Move_Details_Spry = new Spry.Widget.ValidationTextarea("Move_Details_group_Move_Details_Spry",{validateOn:["blur"]});
var Security_Code_Spry = new Spry.Widget.ValidationTextField("Security_Code_Spry", "none",{validateOn:["blur"]});
var Pickup_County_Spry = new Spry.Widget.ValidationTextField("Pickup_County_Spry", "none",{validateOn:["blur"]});
//-->
Could anyone tell me where to look?
Thanks.