PDA

View Full Version : Forms Alerts and Redirection


richard_r
06-25-2002, 02:19 PM
<form name=GoTo>
<form action= // I don't know what to put here
method= // I don't know what to put here
>
<input type=text size=25 value=http://>
<input type= // button or submit.. hmmm
// onClick or onSubmit.. hmmm
// =window.confirm(" Go To : "+ url +" ");

I am unsure where to set the

var url= // the input from the text box

I want the address that the user enters into the text box to be entered as a var so that it can be set on confimation to be opened..

let's say that I type in http://geocities.com
the confirmation opens and asks me, Go To : http://geocities.com ?.. I click ok

then a new widnow opens and http://geocities.com is opened in that second window


Any help would be appreciated:thumbsup:

joh6nn
06-25-2002, 02:25 PM
<form name="GoTo">
<input name="url" type="text" size="25" value="http://">
<input type="button" onClick="goto();">
</form>

<script>
function goto() {
var url = document.GoTo.url.value;
if (window.confirm("Go to" + url + "?")) {
window.open(url);
}
}
</script>

richard_r
06-25-2002, 02:46 PM
If I have any problems with that, I will post again, but thank you for your help.