SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript functions work in firefox but not in IE

    Hi,.

    Im not ashamed to say that I havent the foggiest when it comes to javascript, however I managed to cobble this together from bits and pieces on the net.
    anyway I have 3 drop down boxes that populate depending on the prevoice choices
    The problem i am having is that its not passing the prev variables, and thus not giving them to my php etc.
    you can see what i mean here try it in firefox and then in IE.
    Help please
    Chris




    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    function reload(main)
    {
    var country=main.country.options[main.country.options.selectedIndex].value; 
    self.location='index.php?country=' & country;
    }
    function reload1(main)
    {
    var country=main.country.options[main.country.options.selectedIndex].value; 
    var airport=main.airport.options[main.airport.options.selectedIndex].value; 
    
    self.location='index.php?country=' + country + '&airport=' + airport ;
    }
    
    function reload2(main)
    {
    var val=main.country.options[main.country.options.selectedIndex].value; 
    var val2=main.airport.options[main.airport.options.selectedIndex].value; 
    var val3=main.resort.options[main.resort.options.selectedIndex].value; 
    
    self.location='index.php?country=' + val + '&airport=' + val2 + '&resort=' + val3 ;
    }
    
    function start_again(main){
    self.location='index.php?country=Select%20Country&airport=Select%20Airport&resort=Select%20Resort';
    }
    </SCRIPT>

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Third Stone From The Sun
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're a php developer.

    Code:
    'index.php?country=' & country
    In javascript, we concatenate with '+'. You used '&'.
    My outdated site is down for a while now.


Bookmarks

Posting Permissions

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