Results 1 to 2 of 2

Thread: sending info to second page?

  1. #1
    Join Date
    Apr 2006
    Location
    morden/surrey/uk
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default sending info to second page?

    I've used the following code to fill a dropdown box on a form from a sql database within vbscript, my question is - is there a way to pass on a parameter to the page my dropdown box calls?

    <SCRIPT LANGUAGE="JavaScript">
    function formHandler(form){
    var URL = document.form.site.options[document.form.site.selectedIndex].value;
    window.location.href = URL;
    }
    // End -->
    </SCRIPT>

    <form name="form">
    <select name="site" size=1 onChange="javascript:formHandler()">
    <option value=<% response.write strNotes %>
    </select>
    </form>

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Just a normal form will work.

    then you can use JS (not sure exactly how, sorry) to get the URI of the page.

    Use <form ... method="get"> so it appears in the address bar, and that will work for you.

    Like http://something.com/index.htm?var=value

    php is easier and more secure, depending on your needs.

    With that, it's just <?php echo $_GET['var']; ?>, and your page will show "value" right at that point.

    JS involves splitting the URI at the = sign and a bit more stuff. Not too bad.. but.. why...

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
  •