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 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to pass more than 1 parameter using location.href

    I would like to know how to pass more than 1 parameter/value using location.href

    eg:
    onchange='location.href='second.jsp?field1='+this.value"

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Arizona
    Posts
    336
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tllcll
    I would like to know how to pass more than 1 parameter/value using location.href

    eg:
    onchange='location.href='second.jsp?field1='+this.value"
    What is intented use of this extra parameter/value that you want to past?

    The location object represents the current web address displayed in the browser. The herf property of the location object represents the complete URL.

    Now there are other properties of the location object that represents small parts of the complete URL.

    PhotoJoe

  • #3
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    tllcll - you could just do something like:

    location.href='mypage.php?a=1&b=2&c=3&d=4';
    Die Welt ist ein Irrenhaus und hier ist die Zentrale!

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You just must be careful about what separator you are using and which kind of language/application server uses.

    For a php page, for instace I have succesfully used # as separator
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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