123GoToAndPlay
Aug 16th 2007, 12:26 pm
hi,
My particular form start with 1 main pulldown, depending on the choice either formfieldsA.php or forrmfieldsB.php will be called by an ajax request.
But now i don't know how to set up the JS validation, like i have something in the line of:
<form name="Form" action="?action=step3" method="POST" onsubmit="return Validator(this);">
<select name="segment" id="segment" onchange="javascript:segmentForm2();">
<option value="">Segment</option>
<option value="formfieldsA.php">A</option>
<option value="formfieldsB.php">B</option>
</select>
<div id="formfields" style="display:none;">
</form>
Based on segment the fields from formfieldsA.php or forrmfieldsB.php will be called by an ajax request.
now for the validation part in index.php
function Validator(theForm){
if ( document.Form.segment.value==0)
{ alert('segment'); document.Form.segment.focus(); return false;}
if ( document.Form.cName.value.length<1)
{ alert('name'); document.Form.cName.focus(); return false;}
.....
}
works for all the fields in formfieldsA.php. But how do i check the fields in formfieldsB.php
Any ideas??
My particular form start with 1 main pulldown, depending on the choice either formfieldsA.php or forrmfieldsB.php will be called by an ajax request.
But now i don't know how to set up the JS validation, like i have something in the line of:
<form name="Form" action="?action=step3" method="POST" onsubmit="return Validator(this);">
<select name="segment" id="segment" onchange="javascript:segmentForm2();">
<option value="">Segment</option>
<option value="formfieldsA.php">A</option>
<option value="formfieldsB.php">B</option>
</select>
<div id="formfields" style="display:none;">
</form>
Based on segment the fields from formfieldsA.php or forrmfieldsB.php will be called by an ajax request.
now for the validation part in index.php
function Validator(theForm){
if ( document.Form.segment.value==0)
{ alert('segment'); document.Form.segment.focus(); return false;}
if ( document.Form.cName.value.length<1)
{ alert('name'); document.Form.cName.focus(); return false;}
.....
}
works for all the fields in formfieldsA.php. But how do i check the fields in formfieldsB.php
Any ideas??