passing value to a html from another html

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akb
    New Member
    • Feb 2007
    • 4

    passing value to a html from another html

    hi
    i have two html aa.html and bb.html.
    there is a combo box in aa.html.

    i have to pass the selected combo box value to bb.html.
    and recieve that value in bb.html.

    what i have already tried is listed below:
    aa.html:

    <html>
    <script language="JavaS cript">
    function button_press()
    {
    document.test.a ction="bb.html" ;
    document.test.s ubmit();
    document.write( "<h1>"+document .all.drop1.valu e+"</h1>");
    }
    </script>
    <body>

    <form name=test method=post>

    <select name=drop1>
    <option value=a>debu</option>
    <option value=b>asim</option>
    <option value=c>san</option>
    <option value=d>pari</option>
    </select>
    <input type=submit name=submit value=submit onclick=button_ press()>
    </form>
    </body>
    </html>
    plz help........
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can't use document.write after the page has loaded and in any case, it wouldn't work.

    Use the GET method and the combo box value should be in the url. Then use the location.search property and parse the url for the value in bb.html.

    Comment

    • akb
      New Member
      • Feb 2007
      • 4

      #3
      thanks a lot..

      using window.location .href i have got..

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        No problem. You're welcome.

        Comment

        Working...