Re: calling onchange() javascript event in php

From: Date: Wed, 13 Sep 2000 10:50:40 +0000
Subject: Re: calling onchange() javascript event in php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-16537@lists.php.net to get a copy of this message
dushypops@yahoo.com (dushyanth harinath) writes: > Iam trying to call a javascript function using > onchange() event in a select tag.It gives me a > javascript error which is shown below. > (i,e) > syntax error. > <select name=item_type width=200 onchange=alert("value > changed");> > echo ( > "\n<SCRIPT LANGUAGE='JavaScript' >\n" . > " <!-- \n" . > "<select name=item_type width=200 > onchange=alert(\"value changed\");>\n" . > " // --> \n" . > "</SCRIPT>\n" > ); Why are you putting in <SCRIPT> tags? all you really need is this: print "<select name=item_type width=200 onchange='alert(\"value changed\");'>\n" -- Robin Vickery............................................... Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK Email: robin@planet-three.net Phone: +44 (0)870 729 5444

« previous php.general (#16537) next »