Help with html forms and javascript

Discussion in 'HTML & Website Design' 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. ForumHog

    ForumHog Active Member

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #2
    The most important part of a script is what is inside the post.php file. This is what actually does the work or takes the text from the webpage and inputs it into the url window.

    I'm not sure about taking it from one page and adding it to another but it should be doable.

    Since this is a php question(seems like it to me) try posting the same question in the forum for php help.
     
    ForumHog, Jun 8, 2008 IP
  3. Jxhn

    Jxhn Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, but correct me if I'm wrong, If I use the php file to open the popup then it will be blocked by most popup blockers as the user doesn't directly click anything to make it come up.
     
    Jxhn, Jun 8, 2008 IP