www.webdeveloper.com
Results 1 to 3 of 3

Thread: Putting select.index.value in window.location

  1. #1
    Join Date
    May 2010
    Posts
    17

    Putting select.index.value in window.location

    This works:

    $display="<select name='selDiscId' onclick='alert(this.options[this.selectedIndex].value;'>";
    (The selected value is displayed).

    This doesn't:

    $display="<select name='selDiscId' onclick='window.location=\"EditCd.php?id=this.options[this.selectedIndex].value\";'>";
    (The text "this.options....." is transmitted as the GET parameter).

    Can someone please show me how to get the selected value as the GET parameter using window.location.
    Thanks
    Tony

  2. #2
    Join Date
    Nov 2010
    Posts
    1,047
    it's hard to say, but I think this might work:
    Code:
    $display="<select name='selDiscId' onchange='window.location=\"EditCd.php?id=\"+this.value'>"
    (this.value and this.options[this.selectedIndex].value are the same thing)

  3. #3
    Join Date
    May 2010
    Posts
    17
    Thanks. Perfect.
    Tony

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles