<script>
function doSomething() {
// // alert(document.forms[0].elements['name'].value);
var url = document.forms[0].elements['name'].value;
window.location = url;
return false;
}
</script>
<form onsubmit="return doSomething();" class="my-form">
<input type="text" name="name">
<input type="submit" value="Submit">
</form>
You must include http:// in the address. If you want to make it work well without http://, you can use JavaScript in doSomething
.
© 2024 OneMinuteCode. All rights reserved.