Bug Tracker

Opened 14 years ago

Closed 14 years ago

#4614 closed bug (invalid)

submit bug?

Reported by: jpxavier Owned by: brandon
Priority: major Milestone: 1.4
Component: event Version: 1.3.2
Keywords: submit Cc:
Blocked by: Blocking:

Description (last modified by brandon)

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function() {
	<form name="form1" action="jq.html#test1" method="post">
	<a id="f1_submit" href="#">Form1</a></br>
	<form name="form2" action="jq.html#test2" method="post">
	<a id="f2_submit" href="#">Form2</a></br>
	<a id="f3_submit" href="#">Form2</a></br>

the submitted form always takes the action of the second form? Clicking on f1_submit never submits the first form. but click on f3_submit works fine.

Change History (2)

comment:1 Changed 14 years ago by brandon

Description: modified (diff)

comment:2 Changed 14 years ago by brandon

Resolution: invalid
Status: newclosed

Your selectors are incorrect. Give your forms an id that is the same as the name and just use the id.

Instead of: $("form:form1").submit();

Do this: $("#form1").submit();

Or if you want to stick to the name attribute: $("form[name=form1]").submit();

Selector docs: http://docs.jquery.com/Selectors

Note: See TracTickets for help on using tickets.