javascript : page validation for multiple elements
    I am new to javascript and need to validate the page elements for specific requirment.<BR>

Requirment : User must enter the values in line ( i mean in pair). if user selected value from from first selection box then correponding inputbox must have some value. It should give error if any value entered in any other input box anc correponding select box text shows '(none)'

The code is given as follows.

  <html>

    
    <script language='javascript'>
    function validate(){
     
    		
    }
    </script>
	<body>
	<FORM name="myForm" id="myForm" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">

  

	<TABLE BORDER='0' WIDTH='100%' cellspacing='0' cellpadding='0' >
		<tr><td width='30%' ></td><td width='20%' ></td><td width='40%' ></td><td width='10%' ></td></tr>
		<TR><TD WIDTH='30%' align='right' ></TD><TD WIDTH='20%' align='center' >Range</TD><TD WIDTH='40%' align='center' >Value</TD><TD WIDTH='10%'  >&nbsp</TD></TR>
		<tr ><td colspan='4' height='5'></td></tr>
		<TR >
			<TD height='25' align='right'><font > Number</font></TD><TD align='center'><select name='op0'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld0'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond0' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Year</font></TD><TD align='center'><select name='op1'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld1'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond1' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Designation</font></TD><TD align='center'><select name='op2'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld2'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond2' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Completed date</font></TD><TD align='center'><select name='op3'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld3'  SIZE='20' maxlength='20'  VALUE='dd/mm/yyyy' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond3' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Cancelled date</font></TD><TD align='center'><select name='op4'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld4'  SIZE='20' maxlength='20'  VALUE='dd/mm/yyyy' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond4' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Planned date</font></TD><TD align='center'><select name='op5'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld5'  SIZE='20' maxlength='20'  VALUE='dd/mm/yyyy' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond5' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Service Company</font></TD><TD align='center'><select name='op6'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld6'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond6' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Status</font></TD><TD align='center'><select name='op7'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld7'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond7' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Action At Point</font></TD><TD align='center'><select name='op8'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld8'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond8' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Action</font></TD><TD align='center'><select name='op9'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld9'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond9' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Patch</font></TD><TD align='center'><select name='op10'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld10'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD></TD>
		</TR>

		<tr>
			<td align="right">
			<input type=button id="Submit" value="Submit" onClick="validate()">
				&nbsp;
			<input type=button value="Clear Text" onClick="document.myForm.reset();document.getElementById('Submit').disabled=true" >
			</td>
			<td></td>
			<td></td>
			<td></td>
		</tr>
	</TABLE>
	</Form>
	</body>
</html>		

	
	


javascript : page validation for multiple elements
===

    I am new to javascript and need to validate the page elements for specific requirment.<BR>

Requirment : User must enter the values in line ( i mean in pair). if user selected value from from first selection box then correponding inputbox must have some value. It should give error if any value entered in any other input box anc correponding select box text shows '(none)'

The code is given as follows.

  <html>

    
    <script language='javascript'>
    function validate(){
     
    		
    }
    </script>
	<body>
	<FORM name="myForm" id="myForm" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded">

  

	<TABLE BORDER='0' WIDTH='100%' cellspacing='0' cellpadding='0' >
		<tr><td width='30%' ></td><td width='20%' ></td><td width='40%' ></td><td width='10%' ></td></tr>
		<TR><TD WIDTH='30%' align='right' ></TD><TD WIDTH='20%' align='center' >Range</TD><TD WIDTH='40%' align='center' >Value</TD><TD WIDTH='10%'  >&nbsp</TD></TR>
		<tr ><td colspan='4' height='5'></td></tr>
		<TR >
			<TD height='25' align='right'><font > Number</font></TD><TD align='center'><select name='op0'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld0'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond0' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Year</font></TD><TD align='center'><select name='op1'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld1'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond1' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Designation</font></TD><TD align='center'><select name='op2'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld2'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond2' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Completed date</font></TD><TD align='center'><select name='op3'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld3'  SIZE='20' maxlength='20'  VALUE='dd/mm/yyyy' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond3' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Cancelled date</font></TD><TD align='center'><select name='op4'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld4'  SIZE='20' maxlength='20'  VALUE='dd/mm/yyyy' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond4' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Planned date</font></TD><TD align='center'><select name='op5'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld5'  SIZE='20' maxlength='20'  VALUE='dd/mm/yyyy' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond5' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Service Company</font></TD><TD align='center'><select name='op6'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld6'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond6' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font > Status</font></TD><TD align='center'><select name='op7'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld7'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond7' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Action At Point</font></TD><TD align='center'><select name='op8'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld8'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond8' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Action</font></TD><TD align='center'><select name='op9'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld9'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD><select name='cond9' > <option>and</option><option>or</option></select></TD>
		</TR>
		<TR >
			<TD height='25' align='right'><font >Patch</font></TD><TD align='center'><select name='op10'  > <option selected>(none)</option><option>&lt;</option><option>&lt;=</option><option>=</option><option>&lt;&gt;</option><option>&gt;</option><option>&gt;=</option><option>like</option><option>not like</option><option>in</option><option>not in</option><option>between</option><option>not between</option></select></TD><TD align='center'><INPUT TYPE='TEXT' NAME='crit_fld10'  SIZE='20' maxlength='20'  VALUE=' ' onblur="javascript:this.value=this.value.toUpperCase();"></TD><TD></TD>
		</TR>

		<tr>
			<td align="right">
			<input type=button id="Submit" value="Submit" onClick="validate()">
				&nbsp;
			<input type=button value="Clear Text" onClick="document.myForm.reset();document.getElementById('Submit').disabled=true" >
			</td>
			<td></td>
			<td></td>
			<td></td>
		</tr>
	</TABLE>
	</Form>
	</body>
</html>		

	
	

