Need textbox filled in AFTER submit

Discussion in 'JavaScript' started by schmidte, Dec 4, 2008.

  1. #1
    I'm using a javascript that as you type in one textbox it also appears in another textbox. See Example HERE.

    I would like the search term to appear in the top box ALSO after the query has been submitted.

    Here is the basic code I started with and implemented it with the Google search code:
    <form name="form1">
    <input type="text" name="text1" onKeyup="form1.text2.value=this.value;" />
    <input type="text" name="text2" />
    </form>

    The feature is eventually going to used on a Kids Search engine so that teachers and parents can see from a distance what their child is typing and searching for. I thought about just making the original textbox that big, but it just didn't look right and plus the large box can be at the top of the page for easy viewing.

    Thanks,
    ED
     
    schmidte, Dec 4, 2008 IP
  2. BrandonGregory

    BrandonGregory Peon

    Messages:
    28
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you use ASP, PHP, or another server-side language?
     
    BrandonGregory, Dec 4, 2008 IP
  3. Jake-Johnson

    Jake-Johnson Peon

    Messages:
    839
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Have you tried "Onclick" possibly on the search page, use get/post to display the words in another box:

    
    <form name="form1" action="search.php" method="get">
    <input type="text" name="text1" onKeyup="form.text2.value=this.value;" />
    <input type="text" name="text2">
    </form>
    
    PHP:
    Search.php:
    
    You have searched: <h1><?php echo $_GET['text1']; ?><?php echo $_GET['text2']; ?></h1>
    
    PHP:
     
    Jake-Johnson, Dec 4, 2008 IP