开发者

How would I reset the value of this form with JQuery?

开发者 https://www.devze.com 2023-03-05 19:12 出处:网络
I want to reset the value of this form which sends an AJAX request to the server: <form accept-charset=\"UTF-8\" action=\"/showable_videos\" class=\"new_showable_video\" id=\"new_showable_video\"

I want to reset the value of this form which sends an AJAX request to the server:

<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>

I tried $('form开发者_JAVA技巧#new_showable_video')[0].reset(); but it doesn't seem to work, possibly because a user selects an element from an autocomplete list, and upon selection the AJAX request is sent.


Answer here : Resetting a multi-stage form with jQuery

0

精彩评论

暂无评论...
验证码 换一张
取 消