单击并输入表单后操作提交

时间:2019-01-06 17:45:33

标签: jquery

如何输入Enter?我尝试了12个示例,但是什么也没有。请帮助

$(document).ready(function(){
         $("#send").click(function(){

            var name = $("#name").val();
            var msg = $("#msg").val();

            $.post("action.php", {submit:1,userName:name,userMsg:msg}, function(data){

                $("#done").text(data);
            });
         });

 setInterval(function () {
            $('#show').load('data.php')
        }, 1000);

    });

1 个答案:

答案 0 :(得分:0)

我不知道该怎么解决

<input type="hidden" name="name" id="name" value="<?php echo $_SESSION['login'] ?>"  class="form-control" >
                    <div class="col-sm-10"><input type="text" name="msg" id="msg"  class="form-control" ></div>
                    <div class="col-sm-2" style="padding-left: 35px">
                        <input type="reset" name="send" id="send" value="Send" class="btn btn-primary " >








  $(document).ready(function(){

         $("#send").click(function(){

            var name = $("#name").val();
            var msg = $("#msg").val();

            $.post("action.php", {submit:1,userName:name,userMsg:msg}, function(data){

                $("#done").text(data);
            });
         });

 setInterval(function () {
            $('#show').load('data.php')
        }, 1000);

    });