<script language="JavaScript">
function searchForAll(theForm)
{
//first if date has value and userid is null
if((theForm.date.value != "") && (theForm.useridsel[theForm.useridsel.selectedIndex].value == "null"))
{document.write("The date value is "+theform.date.value);
strUrl = "Files1.asp?dt="+theForm.date.value;
location.href = strUrl;
}
}
//second if date has no value and userid has a value
else if((theForm.date.value == "") && (theForm.useridsel[theForm.useridsel.selectedIndex].value != "null"))
{
document.write("The date value is "+theform.date.value);
strUrl = "Files2.asp?uid="+theForm.useridsel[theForm.useridsel.selectedIndex].value;
location.href = strUrl;
}
}
// third if date and userid both have values
else if((theForm.date.value != "") && (theForm.useridsel[theForm.useridsel.selectedIndex].value != "null"))
{
document.write("The date value is "+theform.date.value+"and the user id is "+theform.useridsel[theform.useridsel.selectedindex].value);
dataValue = theForm.date.value;
selectedUserid = theForm.useridsel[theForm.useridsel.selectedIndex].value;
strUrl = "Files1.asp?uid="+selectedUserid+"&dt="+dataValue;
location.href = strUrl;
}
}
// if date and userid both have no value
else if((theForm.date.value == "") && (theForm.useridsel[theForm.useridsel.selectedIndex].value == "null"))
{
document.write("The date value is "+theform.date.value,"+the user id "+theform.useridsel[theform.useridsel.selectedindex].value);
strUrl = "adminDownloadFiles.asp?dt=";
location.href = strUrl;
}
}
}
</script>
<form name="frm" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="10%"><b>UserId:</b></td>
<td width="20%">
<select name="useridsel" >
<option value="null">All</option>
<option value="1" >Akshara</option>"
</select>
</td>
<script language="javaScript">
t = 0;
strState = "<%=trim(M_UserId)%>";
for (i=0;i<document.frm.useridsel.length;i++)
if(document.frm.useridsel.value == strState) t=i;
document.frm.useridsel[t].selected = true;
</script>
<td width="10%"> </td>
<td width="10%"><b>Date:</b></td>
<td width="20%">
<input type="text" name="date" size="12" maxlength="10">
</td>
<td width="30%">
<input type="button" name="Button" value="Search" onClick="searchForAll(this.form)">
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>