0

HI
I want to write a search for my site .I make a new panel in the left of my menue and it has a text input and an image which when that user click on it javascript opens a new window which is a php page.The part I don't know how to do is when the user click on the image it should get the content of the text input and pass it to the url.For the hyperlink of the image I use "<a href="javascript:open_window('includes/func/search.php?id=" But I don't know what should I write after that to get the content of the text input and put it in the next of the id.
How can I do so?

Thanks

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Alxandr
0

Give the text-field an id (if you haven't, I'll use myTextField), then try this: <a href="javascript.open('includes/func/search.php?id='+encodeURIComponent(document.getElementById('myTextField').value)));">...</a>

Edited by Alxandr: n/a

0

Give the text-field an id (if you haven't, I'll use myTextField), then try this: <a href="javascript.open('includes/func/search.php?id='+encodeURIComponent(document.getElementById('myTextField').value)));">...</a>

Thanks for your reply but it doesn't work and when I clicked on it the url change to :javascript.open_window('includes/func/search.php?id='+encodeURIComponent(document.getElementById('pursue').value)));
Please help me how can I do so?
Thanks

0

Thanks for your reply but it doesn't work and when I clicked on it the url change to :javascript.open_window('includes/func/search.php?id='+encodeURIComponent(document.getElementById('pursue').value)));
Please help me how can I do so?
Thanks

Sorry, typo, there should be a colon after javascript and then window.open. Try <a href="javascript:window.open('includes/func/search.php?id='+encodeURIComponent(document.getElementById('myTextField').value));">...</a> . This is tested working in FF3.5

Edited by Alxandr: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.