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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -