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:
try: method="post"
in form or use <button type="submit"></button>
Comments
Post a Comment