Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript IE中的Bootstrap输入验证_Javascript_Jquery_Internet Explorer_Twitter Bootstrap - Fatal编程技术网

Javascript IE中的Bootstrap输入验证

Javascript IE中的Bootstrap输入验证,javascript,jquery,internet-explorer,twitter-bootstrap,Javascript,Jquery,Internet Explorer,Twitter Bootstrap,引导允许用户根据需要指定输入,以及定义数据类型和所需模式。不幸的是,这在IE 10之前的任何版本中都不起作用 有谁知道javascript验证插件,它可以读取分配给输入的属性,以弥补IE的不足?我遇到了同样的问题,我使用了下面的插件,它工作得很好 Official Plugin Page 它可以很容易地与AJAX一起使用:(如果您不想使用AJAX,只需编辑该部分) 成功 失败 名称: 联系电话: 电子邮件: 提交 $(函数() { var form=$(“#示例_form”).vali

引导允许用户根据需要指定输入,以及定义数据类型和所需模式。不幸的是,这在IE 10之前的任何版本中都不起作用


有谁知道javascript验证插件,它可以读取分配给输入的属性,以弥补IE的不足?

我遇到了同样的问题,我使用了下面的插件,它工作得很好

Official Plugin Page

它可以很容易地与AJAX一起使用:(如果您不想使用AJAX,只需编辑该部分)


成功
失败
名称:
联系电话:
电子邮件:
提交 $(函数() { var form=$(“#示例_form”).validate(); $(“表单”示例表单”).submit(函数(){ if(form.valid()) { var name=$(“#txtName”).val(); var email=$(“#txtEmail”).val(); var phone=$(“#txtPhone”).val(); $.ajax({ url:“process.php”, 类型:“POST”, 数据:{ “名称”:名称, “电子邮件”:电子邮件, “电话”:电话 }, 数据类型:“json”, 成功:功能(数据){ 如果(data.status==“成功”) { $(“#成功”).show(); } else if(data.status==“error”) { $(“#失败”).show(); } } }); 返回false; } }); });
检查。你可以试试,也可以看看这里。否则,您可以检查或
GitHub
CDN
EXAMPLE CODE:
<form id="example_form" action="process.php" method="POST" novalidate="novalidate">
<span style="display: none;" id="success">Success</span>
<span style="display: none;" id="failure">Failure</span>

<label for="Name">Name:<br> 
                    <input type="text" id="txtName" required="" class="required">
                </label>
<label for="Phone">Contact No:<br> 
                    <input type="tel" id="txtPhone" required="" class="required number">
                </label>
<label for="Email">Email:<br> 
                    <input type="email" id="txtEmail" required="" class="required email">
                </label>
<button type="submit">Submit</button>
</form>


  $(function()
  {

var form = $("#example_form").validate();
$("form#example_form").submit(function() {
                    if(form.valid())
                    {
                        var name = $("#txtName").val();
                        var email = $("#txtEmail").val();
                        var phone = $("#txtPhone").val();

                        $.ajax({
                        url: "process.php",
                        type: "POST",
                        data: {
                                'name': name,
                                'email': email,
                                'phone': phone
                                },
                        dataType: "json",
                        success: function(data) {
                              if(data.status == 'success')
                              {
                                    $('#success').show();
                              }
                              else if(data.status == 'error')
                              {
                                    $('#failure').show();
                              }
                            }
                        });
                return false;
                }
        }); 
});