PDA

Click to See Complete Forum and Search --> : This code is broken


joey o.
Oct 31st, 2000, 07:44 PM
Hi,I went to Serge's new site before it went down and he gave me this code, but my machine tells me it wants a ";" on line 5? All things look right to me and I have no problem running other Javascripts.Anyone know?
code;

<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=VBScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<Script LANGUAGE=JavaScript>
Function Redirect()
{
var strURL;

strURL = cboMyDropdown.options(cboMyDropdown.selectedIndex).innerText;
location.href = "MyOtherPage.asp?cboMyDropdown=" & strURL;
}


</Script>
</HEAD>
<BODY>
<P>
<SELECT name="cboMyDropdown" id="cboMyDropdown" size="1">
<OPTION Value="Index1">Value1</OPTION>
<OPTION Value="Index2">Value2</OPTION>
<OPTION Value="Index3">Value3</OPTION>
<OPTION Value="Index4">Value4</OPTION>
</SELECT>
</P>
<INPUT type=Button value=Submit id=submit1 name=submit1 OnClick="Redirect()">
</BODY>
</HTML>



Second Page (MyOtherPage.asp)

'Request object will have the value of the selected item in the dropdown
Response.Write Request("cboMyDropDown")

Mark Sreeves
Nov 1st, 2000, 03:41 AM
"Function" should be "function"

javacsript is case sensitive

KENNNY
Nov 4th, 2000, 02:16 PM
dont u just hate that?? c++, jscript, etc are all case senstive and it's really annoying cos u keep having to press shift :(