Jump to content

Get the value of text box


houssam_ballout

Recommended Posts

hello all, I'd the following form: <form name='test'> <input type='text' name='test1' /> </form> and the following pic:<img src="images/index_25.gif" width="38" height="51" alt="" border="0" style="cursor:pointer" onClick="NewWindow('resultsPage.php?search=this.test.test1.value','Results Page','800','800','yes','center')"> </a>wat i Want to do is:The new window open must have the resultPage.php opened with the value of the text box?Thanks in advance

Link to comment
Share on other sites

Considering the way the URL looks, i'd say

<?phpecho $_GET['search'];?>

but I think you need to somehow separate the "this.test.test1.value" from the rest of it. And I'm not sure exactly how you do that in JavaScript. Perhaps this:

'resultsPage.php?search=' . this.test.test1.value

Link to comment
Share on other sites

Considering the way the URL looks, i'd say
<?phpecho $_GET['search'];?>

but I think you need to somehow separate the "this.test.test1.value" from the rest of it. And I'm not sure exactly how you do that in JavaScript. Perhaps this:

'resultsPage.php?search=' . this.test.test1.value

About the php side, I can do it, but I just need the correct syntax for the javasrcipt oneThanks
Link to comment
Share on other sites

It would look something like this:

onclick="NewWindow('resultsPage.php?search=' + document.test.test1.value,'Results Page','800','800','yes','center');"

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...