html - redirect including input type value at submit form -
any thoughts why redirect doesn't work @ form submit? should redirect user url specified in js function, appending value input form
<form> <div class="input-wrap"> <input type="text" id="myinputtype" class="block" /> <input type="submit" name="submit" class="block" onsubmit="redirect()" /> </div> </form> ` <script type="text/javascript"> function redirect() { window.location = 'http://somewhere.com?url=' + document.getelementbyid('myinputtype').value; } </script>
i think onsubmit=''
goes form tag <form onsubmit="redirect();">
not on input
Comments
Post a Comment