PHP Form > window.open

Discussion in 'PHP' started by brianj, Apr 26, 2009.

  1. #1
    Hi, simple question..

    I have a simple form that i want to open a google search in a popup:

    <FORM NAME="myform" ACTION="" METHOD="GET">
    <INPUT TYPE="text" NAME="field1" VALUE="">
    <INPUT TYPE="text" NAME="field2" VALUE="">
    <INPUT TYPE="button" NAME="button" Value="Open Window" 
    onClick="window.open('http://www.google.com/search?hl=en&q=', '', 'width=460, height=460')">
    </FORM> 
    PHP:

    Anyone can help me put the 2 field values into the string?

    Thanks:)
     
    brianj, Apr 26, 2009 IP
  2. JDevereux

    JDevereux Peon

    Messages:
    50
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    onClick="window.open('http://www.google.com/search?hl=en&q='+document.myform.field1.value+'+'+document.myform.field2.value, '', 'width=460, height=460')">
     
    JDevereux, Apr 26, 2009 IP
  3. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #3
    it's so easy?

    great ... :)
    thnx for your info ...

    regards
     
    ghprod, Apr 27, 2009 IP