SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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: below is only 1 parameter
    onchange='location.href='second.jsp?field1='+this.value"

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First, you have some quote problems.

    Second, you aren't using location.href to pass values, you're using the url to pass values. The url you specify for location.href will load in the window. The page that loads can then pick out the values that are attached to the end of the url. Multiple values are separated by the symbol "&":

    second.jsp?field1=10&name=Sally

  3. #3
    SitePoint Evangelist nsj's Avatar
    Join Date
    Oct 2005
    Location
    Jamaica (W.I)
    Posts
    447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i.e.
    econd.jsp?field1=10&name=Sally
    Yesterday 01:50
    tllcll I would like to know how to pass more than 1 parameter/value using location.href

    <select onchange="location.href='second.jsp?field1="+this.value+"&name=Sally+"'">
    ...</select>
    The end has a double quote, single quote, and double quote again.

    Cheers.


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
  •