Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: onChange Event.


Message #1 by "Tim O'Callaghan" <tocallag@s...> on Thu, 24 Jan 2002 17:03:47
Why should the following line of code?

document.Select.docs.value =3D =09
	document.Select.docs.options
[document.DOCS.docs.selectedIndex].value;

Infact if you are using a servlet or a jsp (or even an asp for that
matter i guess),
if you say request.getParameter("docs");, it should give you the
selected value.
Try it an let me know if it fails.

regards,
Nitin


-----Original Message-----
From: Tim O'Callaghan [mailto:tocallag@s...]
Sent: Thursday, January 24, 2002 10:34 PM
To: JavaScript HowTo
Subject: [javascript_howto] onChange Event.


Hello all!

The following code continually gives me the following error message

 'document.Select.docs' is null or not an object

I've tried looking at this in every way for a fix but I've had zero
success.

The code is as follows:

<script LANGUAGE=3D"JavaScript">
<!--
function GetReport()
{
	document.Select.docs.value =3D =09
	document.Select.docs.options
[document.DOCS.docs.selectedIndex].value;
	document.Select.action =3D "Docs.asp"
	document.Select.submit();
}
// -->
</script>

and the call for the function from the form is ..

<FORM ID=3DSelect NAME=3DSelect ACTION=3D"Docs.asp" METHOD=3D"POST">
		  <SELECT ID=3Ddocs NAME=3Ddocs SIZE=3D"15"
onChange=3DGetReport()>
		  <OPTION VALUE=3D"Frame Relay">Frame Relay</OPTION>
		  <OPTION VALUE=3D"ISDN">ISDN</OPTION>
		  <OPTION VALUE=3D"Private Line">Private Line</OPTION>
		  <OPTION VALUE=3D"Internet">Internet</OPTION>
		  <OPTION VALUE=3D"DAL">DAL</OPTION>
		  <OPTION VALUE=3D"ATM(TLS,IMA)">ATM(TLS,IMA)</OPTION>
		  <OPTION VALUE=3D"IP VPN">IP VPN</OPTION>
		  <OPTION VALUE=3D"MNS/AMNS">MNS/AMNS</OPTION>
		  <OPTION VALUE=3D"SSASP">SASP</OPTION>
		  <OPTION VALUE=3D"Hardware">Hardware</OPTION>
		  <OPTION VALUE=3D"Telco Info">Telco Info</OPTION>
		  <OPTION VALUE=3D"Misc.">Misc.</OPTION>
		  </SELECT>

thank you in advance for your help, this has been driving my NUTS! :)

Tim
$subst('Email.Unsub').

  Return to Index