Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Whats wrong with this code?...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Whats wrong with this code?...

 Post Reply Post Reply
Author
vidyaraghav View Drop Down
Newbie
Newbie


Joined: 22 September 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote vidyaraghav Quote  Post ReplyReply Direct Link To This Post Topic: Whats wrong with this code?...
    Posted: 02 October 2003 at 4:56am

Can you please tell me whats wrong with the following code

<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%">&nbsp;</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>&nbsp;</td>

</tr>

</table>

Back to Top
Bullschmidt View Drop Down
Groupie
Groupie


Joined: 31 May 2003
Location: United States
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bullschmidt Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2003 at 6:39am
You may want to ask in a JavaScript board like http://www.codingforums.com/forumdisplay.php?s=&forumid= 2
J. Paul Schmidt, Freelance ASP Web Developer
www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2003 at 6:54am

If you want people to help you, you need to offer as much information about your problem as you can.

If you are getting an error in your javascript, you should post the error that you are getting.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.