dongshenling6585 2014-08-08 18:06
浏览 55
已采纳

提交ajax后如何清理表单?

First of all: I tried to search the answer in the web and I found like 20 examples of code. But I failed. still nothing is working.

I'm making a simple chat and i need to clean my form after submitting data via ajax. Here is the code:

<form id="ChatFrom" class="chatMessageField" action="Amess.php" method="post">
    <input class="chatMessageField" type="text" name="mess" /><br />
    <input class="chatMessageBtn" type="button" value="Отправить" onclick="SendForm();" />
</form>

<script type="text/javascript" src="http://scriptjava.net/source/scriptjava/scriptjava.js"></script>
<script type="text/javascript">
    function SendForm() {
        $$f({
            formid:'ChatFrom',
            url:'Amess.php',
        });
    }
</script>
  • 写回答

3条回答 默认 最新

  • duankanjian4642 2014-08-08 18:12
    关注
    $("#ChatFrom")[0].reset()
        // or
     $("#ChatFrom").get(0).reset()
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
  • ¥15 机器人轨迹规划相关问题
  • ¥15 word样式右侧翻页键消失