|
-
Jan 10th, 2001, 09:19 AM
#1
Thread Starter
Hyperactive Member
Hi,
Someone gave me this code which is executed when the submit button is clicked. As you can see I have a dropdown menu called "lstcountry "which is filled with Country names.
How can I change this code to return the TEXT VALUE of what was selected and NOT the index/no.
As it is now, it returns "1" when AUSTRALIA is selected, but I want it to return "AUSTRALIA".
Another question is..
what is the equivalent of response.write in javascript. Reason for asking is because I want to debug this code so when it enters this I want it to do a response.write lstcountry, but the javascript equivalent of that!!
<head><script language="javascript">
function redirectpage()
{
if(document.frmcountry.lstcountry.options[document.frmcountry.lstcountry.selectedIndex].value == 0)
{
document.frmcountry.action = "city.asp";
document.frmcountry.submit();
}
else
{
document.frmcountry.submit();
}
}
</script>
-
Jan 10th, 2001, 10:22 AM
#2
-
Jan 10th, 2001, 11:07 AM
#3
Thread Starter
Hyperactive Member
Hi Mac,
This looks like what I need. The alert however brings up a MSGBOX with the name of the country selected.
So at least I know that it does actually know what COUNTRY I selected. How can I now populate a variable with that text ie. instead of bringing up the MSGBOX, populate a variable on which I will then do some "if then else" tests!!
Thanks very much for your help.
T
-
Jan 10th, 2001, 11:27 AM
#4
Guru
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|