Hi, Lets say the text field has a default value of url (ex. http://www.google.com/) then I type something to the text field, lets say i typed the word "hello" then click Submit. It should popup the site http://www.google.com/hello BTW, each text field must hav diffrent URL values I have this html but i don't know JS, im not programmer. sorry http://amedillo.vndv.com/magic/helper.htm any help would be appreciated Thank you very much
If I have understood you correctly, this is what you want: <html> <head> <title></title> <script type="text/javascript"> url = "http://google.com/"; function siteOpener(text) { window.open(url+text,"mywindow"); } </script> <style type = "css/text"> body { background: #fff; font-family:Arial 10px; } .span { font-size: 9px; font-family:Arial } </style> </head> <body> <form id="form1" name="form1" method="post" action=""> <input type = "text" name = "text1"> <input type = "button" name = "vhy" value = "Submit" onclick="siteOpener(document.form1.text1.value);"><span>vhy</span><br /> <!-- button 1 --> <input type = "text" name = "text2"> <input type = "button" name = "hy" value = "Submit"><span>hy</span><br /><!-- button 2 --> <input type = "text" name = "text3"> <input type = "button" name = "shy" value = "Submit"><span>shy</span><br /> <!-- button 3 --> <input type = "text" name = "text4"> <input type = "button" name = "ns" value = "Submit"><span>ns</span><br /> <!-- button 4 --> </form> </body> </html> Code (markup):
<html> <head> <title></title> <script type="text/javascript"> url = "http://google.com/"; function siteOpener(text) { window.open(url+text,text); } </script> <style type = "css/text"> body { background: #fff; font-family:Arial 10px; } .span { font-size: 9px; font-family:Arial } </style> </head> <body> <form id="form1" name="form1" method="post" action=""> <input type = "text" name = "text1"> <input type = "button" name = "vhy" value = "Submit" onclick="siteOpener(document.form1.text1.value);"><span>vhy</span><br /> <!-- button 1 --> <input type = "text" name = "text2"> <input type = "button" name = "hy" value = "Submit" onclick="siteOpener(document.form1.text2.value);"><span>hy</span><br /><!-- button 2 --> <input type = "text" name = "text3"> <input type = "button" name = "shy" value = "Submit" onclick="siteOpener(document.form1.text3.value);"><span>shy</span><br /> <!-- button 3 --> <input type = "text" name = "text4"> <input type = "button" name = "ns" value = "Submit" onclick="siteOpener(document.form1.text4.value);"><span>ns</span><br /> <!-- button 4 --> </form> </body> </html> Code (markup):
<input type = "text" name = "text1"> <input type = "button" name = "button" value = "Submit" onclick="alert(document.getElementById('text1').value)">