javascript - submitting a form via jquery removes submit input variable -


here's html:

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form id="test" method="get" action="">     <input type="hidden" name="var1" value="true" />     <input type="submit" name="var2" value="submit" /> </form> <script> $("#test").submit(); </script> 

the resultant request that makes has var1 in not var2. question why , can var2?

here's live demo:

http://www.frostjedi.com/terra/dev/submit.php

try: method="post" in form or use <button type="submit"></button>


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -