【问题标题】:How would I reset the value of this form with JQuery?如何使用 JQuery 重置此表单的值?
【发布时间】:2011-05-15 05:54:18
【问题描述】:

我想重置这个向服务器发送 AJAX 请求的表单的值:

<form accept-charset="UTF-8" action="/showable_videos" class="new_showable_video" id="new_showable_video" method="post"><div style="margin:0;padding:0;display:inline">
    <input name="utf8" type="hidden" value="✓">
    <input name="authenticity_token" type="hidden" value="+hPWXwRBfAfz5lCKJRM3QouBzsYuje+wgGKb2OAH7Z4="></div>
    <input id="video_id_field" name="showable_video[video_id]" type="hidden" value="506">
    <input class="showable_field ui-autocomplete-input" id="showable_video_profile" name="showable_video[profile]" size="30" type="text" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true">
</form>

我尝试了$('form#new_showable_video')[0].reset();,但它似乎不起作用,可能是因为用户从自动完成列表中选择了一个元素,并且在选择时发送了 AJAX 请求。

【问题讨论】:

    标签: ajax forms jquery reset


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-17
      • 1970-01-01
      • 2011-07-24
      • 1970-01-01
      • 1970-01-01
      • 2011-12-15
      相关资源
      最近更新 更多