I have a search page where there are 3 options to search. The query string is passed along with file name to 3 types of search.
I am not able to validate the field for src_type="nsearch";
<script>
function validate(){
if((document.searchType.os.value == "--") && (document.searchType.type.value=="--")){
alert("Select Criteria");
document.searchType.ostype.focus();
return false;
}
}
</script>
if(src_type=="topn"){
<form id=searchType name=searchType method="get" onSubmit="return validate()" action="<?=$_SERVER['PHP_SELF']?>">
<td><a href=search.php?src_type=topn>Top N</a></td>
<div style=width:980px align=center>
<table border=0 cellpadding=0 cellspacing=8>
<tr>
<td align="left"><label><font color="#006699" face="Arial">Operating System </font></label></td>
<td align=left>
<select id="os" name='os'>
<option value="--" selected>--
<option value="AIX">AIX
<option value="Linux">Linux
<option value="Solaris">Solaris
</select>
<td align=left>
<select id="type" name='type'>
<option value="--" selected>--
<option value="A">A
<option value="L">L
<option value="S">S
</select>
}
Here I am not able to validate the list box because of the query string. How to validate the box