PDA

View Full Version : Need some help using JavaScript with PHP


CodagenDev
07-30-2002, 09:51 PM
Hi:

I have a question about using Javascript in PHP pages. I was in need of a javascript that changed the values in one combo box base on what the user selected in another combo box. I found one on JavasciptKit here is the link to it.
double combo box (http://www.javascriptkit.com/script/cut183.shtml)

Now the problem is that in a static HTML webpage the script works fine. But when I try and embed it in a php page .php not a HTML page that has php tags in it the script does not work.

Anyone have any ideas as to why?

Thanks

Spookster
07-30-2002, 10:17 PM
That should not have any effect on the script. Ensure that you are not enclosing any of the javascript within the php tags for example:

<?php

make sure the javascript doesn't lie in between any of these.

?>

CodagenDev
07-31-2002, 05:09 PM
Thanks Spookster, after your suggestion and some rewriting of the javascript I was able to get the combo boxes working .

Thanks again :D