Monday, March 14, 2005

Form - Textbox Question

I have an input textbox where users would enter a URL. I want to have a button next to the textbox that would test that URL by opening it in a textbox.

The question is: how can I pass the value of the "previewText" textbox to the URL portion of the "window.open" command, so that that URL is open in the popup window?

<script language="javascript">
<!--
function CheckURL(url){
window.open(url,"Preview","width=400,height=150,
scrollbars=yes,resizable=yes,status=0");
}
//-->
</script>

<form name="testfrm">
<input type="text" name="test"/>
<input type="button" name="check" value="Check URL" onclick="javascript:CheckURL(document.testfrm.test.value);"/>
</form>

0 Comments:

Post a Comment

<< Home