我有一个按钮,我想用户点击它变成像一个this微调所以我在想什么是有像这样......通过jquery交换?
<form method="post" id="new_resource" class="new_resource" action="/resources">
<div class="field">
<input type="text" size="30" name="resource[url]" id="resource_url">
<input type="hidden" value="5" name="resource[course_id]" id="resource_course_id">
</div>
<div class="actions">
<input type="submit" value="Create" name="commit" id="resource_submit">
</div>
</form>
所以,我需要的是,如果有人点击在提交表单按钮id =“resource_submit,我会显示一个微调...我正在考虑将spinner放在这个输入标签下面的跨度或图像标签,但我不能确定最好的方式...
这是我的jquery到目前为止
$('form').submit(function(e){
$(this).find('#resource_submit').hide();
e.preventDefault();
});
我在页面上有多种形式,所以这就是为什么我使用这种方法,但我不知道如何实现微调逻辑
除了别人都已经回答了,因为你有多种形式,你应该使用,而不是为选择一个ID类。 DOM中不能有重复的ID。 – glomad 2011-02-23 16:20:13