Help with JavaScript and html forms.

Discussion in 'JavaScript' started by Jxhn, Jun 8, 2008.

  1. #1
    I need help getting data from a form input into the url of a popup window.

    This is what I've tried:
    
    <form name="form" action="post.php" method="post">
    Your name:<br>
    <input type="text" name="name">
    <input type="submit" name="submit" value="Submit" onClick="window.open('http://www.website.com/site.php?name= + form.name.value','newwindow','width=500','height=500');>
    </form>
    
    Code (markup):
    Why isn't this working and what can I do to make it work?
     
    Jxhn, Jun 8, 2008 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    change

    form.name.value

    to

    document.form.name.value
     
    crath, Jun 8, 2008 IP