Hi
I am trying to validate a form with different type of message for different error, but you can see http://cbsecsnip.in/csnip/form.php Here the problem. Please guide me in solving this problem...
Partial Code of form.php-
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Your Valuable Suggestion</title> <link rel="stylesheet" type="text/css" href="view.css" media="all"> <script type="text/javascript"> function notEmpty(elem, helperMsg){ if(elem.value.length == 0){ document.getElementById('divforTextBox').innerHTML = helperMsg; elem.focus(); return false; } document.getElementById('divforTextBox').innerHTML = ""; return true; } </script> </head> <body id="main_body" > <img id="top" src="top.png" alt=""> <div id="form_container" <form id="form_453570" class="appnitro" method="post" action="insertform.php"> <div class="form_description"> <h1>cbse cs n ip looks forward for your valuable suggestion</h1> <p>Please fill all the <font color="#EC0006">*</font> marked fields in CAPITAL letters. All <font color="#EC0006">*</font> marked fields are mandatory</div> <ul > <li id="li_12" > <label class="description" for="element_12">First Name <font color="#EC0006">*</font> </label> <div> <input id="element_12" name="element_12" class="element text large" type="text" maxlength="255" value="" onblur="notEmpty(document.getElementById('element_12'), 'Please Enter Your First Name')"/> <div id='divforTextBox'></div> </div> </li> <li id="li_13" > <label class="description" for="element_13">Last Name <font color="#EC0006">*</font></label> <div> <input id="element_13" name="element_13" class="element text large" type="text" maxlength="255" value="" onblur="notEmpty(document.getElementById('element_12'), 'Please Enter Your Last Name')"/> <div id='divforTextBox'></div> </div> </li> <!-- Rest of the code --> <li id="li_11" > <li class="buttons"> <input type="hidden" name="form_id" value="453570" /> <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" /> </li> </ul> </form> <div id="footer"></div> </div> <img id="bottom" src="bottom.png" alt=""> </body> </html>


Reply With Quote
Bookmarks