Jump to content

seperating the javascript empty field alerts


sphinx

Recommended Posts

Hi there,

 

At present i'm using this to check for blank fields:

 

<script language="JavaScript">
var frmvalidator  = new Validator("contact_form");
frmvalidator.EnableOnPageErrorDisplaySingleBox();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("name","req","You have not entered a name."); 
frmvalidator.addValidation("email","req","You must supply an email address."); 
frmvalidator.addValidation("message","req","You have not entered a message.");
frmvalidator.addValidation("email","email","That email address you have supplied is not valid."); 
frmvalidator.addValidation("sixletterscode","req","Please enter the four characters into the specified box.");
</script>

 

which relates too:

 

<form method="POST" name="contact_form" action="/?captcha_fail">

 

At present, that puts the errors in one block like:

 

    You have not entered a name.
    You must supply an email address.
    You have not entered a message.
    Please enter the four characters into the specified box.

 

And is displayed by:

 

<div id='contact_form_errorloc' class='err'></div>

 

Basically, I want to seperate the prompts under each field instead of all clumped together.

 

Many thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.