PDA

View Full Version : Help with URL test link



johndx
Mar 26th, 2007, 01:17 AM
Hi

Can anyone help with a problem im having...
Im try to create a URL "Test" link

Basically, in a form that has a URL field i want a "test" link next to it so
users can test the url entered before submiting the form.

Any help would be most grateful!!!

:thumbsup:

glenngv
Mar 26th, 2007, 06:45 AM
<form name="frm">
...
<input type="text" name="url" />
<a href="#" onclick="return loadURL();">Test Link</a>
...
</form>
<script type="text/javascript">
function loadURL(){
var link = document.frm.url.value;
if (link){
location.href = link; //same window
//window.open(link, "_blank"); //new window
}
return false;
}
</script>