Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Go To Address in Text Box Button

Status
Not open for further replies.

antdickens

Programmer
Nov 13, 2001
129
GB
Hi,

I've been trying somewhat unsuccesfully to create a button which opens a new browser window which goes to the address within a text box on the page.

Could anyone give me any pointers

TIA
 
I don't know if I got you right, but this is what I think you want to have:

file 'a.html' with a button that will call another page:
Code:
<html>

<body>

<form action=&quot;b.html&quot; target=&quot;_blank&quot;>
<input type=&quot;submit&quot;>
</form>

</body>

</html>

file 'b.html' with text field:
Code:
<html>

<body>

<form>
<input type=&quot;text&quot;>
</form>

</body>

</html>

Is that all, or did you want to parse some information from side a to b?

Cheers

frag

patrick.metz@epost.de
 
oh... I guess I got you wrong.... try this one:

Code:
<html>

<head>
<script type=&quot;text/javascript&quot; language=&quot;JavaScript&quot;>
<!--
function GoToURL() {
  
var URLis;
 URLis = document.myForm.Dest.value
  
   if (URLis == &quot;&quot; || URLis.length <= 8)
   { 
     alert('\nOops!\n\nYou must enter a valid URL');
   } 
   else
   {
     this.location.href = URLis;
   }
}
//-->
</script>
</head>

<body>

<form name=&quot;myForm&quot;>
<input type=&quot;text&quot; value=&quot;[URL unfurl="true"]http://www.tek-tips.com&quot;[/URL] name=&quot;Dest&quot;>
<input type=&quot;button&quot; value=&quot;go to url&quot; onClick=&quot;GoToURL()&quot;>
</form>

</body>

</html>

patrick.metz@epost.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top