Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Need some help using JavaScript with PHP

    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

    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

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.

    ?>
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    Thanks Spookster, after your suggestion and some rewriting of the javascript I was able to get the combo boxes working .

    Thanks again


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •