Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.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
Angularjs 如何停止禁用Angular Js中的提交按钮_Angularjs_Forms_Validation_Submit - Fatal编程技术网

Angularjs 如何停止禁用Angular Js中的提交按钮

Angularjs 如何停止禁用Angular Js中的提交按钮,angularjs,forms,validation,submit,Angularjs,Forms,Validation,Submit,我有一个表单,其中我打印的值基本上是一个更新表单,情况是用户不能发送更新中的空字段。但问题是我有两个字段,它们实际上是password和confirm password我没有得到它们的值,因此它们的搜索框将为空 案例-1 现在,我如何在更新表单中发送除password和confirm password之外的所有值,如果除了password和confirm password 案例-2 如果用户在password的搜索框中键入某个内容,然后摩擦它,表单中的所有字段都会转到password和confi

我有一个表单,其中我打印的值基本上是一个更新表单,情况是用户不能发送更新中的空字段。但问题是我有两个字段,它们实际上是
password
confirm password
我没有得到它们的值,因此它们的搜索框将为空

案例-1

现在,我如何在更新表单中发送除password和confirm password之外的所有值,如果除了
password
confirm password

案例-2

如果用户在
password
的搜索框中键入某个内容,然后摩擦它,表单中的所有字段都会转到password和confirm password之外,该如何操作

简而言之,除了
密码
确认密码
之外,我想发送所有已填写的字段,并且在任何情况下,如果它们已填写,也应该将它们张贴出来

我正在分享我的完整表格,我确实申请了有效信息,但这是因为
密码
的空框和
确认密码
我的提交按钮被禁用

<form class="col-md-8" name="updateprofileForm" ng-submit="update_profile()" novalidate>
                            <div class="form-group">
                                <p ng-show="updateprofileForm.username.$invalid && !updateprofileForm.username.$pristine" class="help-block color-ferozimp">Enter a valid Username</p>
                                <label for="text">Full Name:</label>
                                <input class="form-control" name="username" id="name" type="text" ng-model="profileData.username" ng-maxlength="40" required>
                            </div>
                            <div class="form-group">
                                <p ng-show="updateprofileForm.email.$invalid && !updateprofileForm.email.$pristine" class="help-block color-ferozimp">Enter a valid email</p>
                                <label for="text">Email:</label>
                                <input class="form-control" name="email" id="email" type="email" ng-model="profileData.email" ng-disabled="true" required>
                            </div>
                            <div class="form-group">
                                <p ng-show="updateprofileForm.password.$invalid && !updateprofileForm.password.$pristine" class="help-block color-ferozimp">Enter a 10 character Password</p>
                                <label for="pwd">Password:</label>
                                <input class="form-control" id="pwd" type="password" ng-model="profileData.password" name="password" ng-minlength="10" ng-maxlength="40" required>
                            </div>
                            <div class="form-group">
                                <p ng-show="updateprofileForm.confirmpassword.$invalid && !updateprofileForm.confirmpassword.$pristine" class="help-block color-ferozimp">Enter confirm Password</p>
                                <p ng-show="profileData.password !== profileData.confirmpassword && profileData.confirmpassword" class="help-block color-ferozimp">Password does not match</p>
                                <label for="pwd">Confirm Password:</label>
                                <input class="form-control" id="pwd" type="password" ng-model="profileData.confirmpassword" name="confirmpassword" ng-minlength="10" ng-maxlength="40" >
                            </div>
                            <div class="form-group">
                                <p ng-show="updateprofileForm.phone_no.$invalid && !updateprofileForm.phone_no.$pristine" class="help-block color-ferozimp">Enter Valid Phone Number</p>
                                <label for="pwd">Mobile No:</label>
                                <input class="form-control" id="pwd" type="text" ng-model="profileData.phone_no" name="phone_no" ng-minlength="7" ng-maxlength="40" required>
                            </div>
                            <div class="form-group  mg-bseven">
                                <p ng-show="updateprofileForm.country_id.$invalid && !updateprofileForm.country_id.$pristine" class="help-block color-ferozimp">Choose a Country Please </p>
                                <label for="country">Country:</label>
                                <select class="col-md-12 col-sm-12 col-xs-12 register" name="country_id" ng-change="cities(profileData.country_id)" ng-model="profileData.country_id" ng-options="country.id as country.name for country in view_profile" required>
                                </select>
                            </div>
                            <div class="form-group mg-bseven">
                                <p ng-show="updateprofileForm.city_id.$invalid && updateprofileForm.city_id.$dirty" class="help-block color-ferozimp">Choose a City Please</p>
                                <label for="city">City:</label>
                                <select class="col-md-12 col-sm-12 col-xs-12 register" name="city_id" ng-disabled="!profileData.country_id || !view_profile" ng-model="profileData.city_id" ng-options="city.id as city.name for city in cities_data" required>
                                </select>
                            </div>
                            <div class="form-group mb-seven" ng-init="check = 0">
                                <button type="button" ngf-select="uploadFiles($file, $invalidFiles,check)"
                                        accept="image/*" ngf-max-height="1000" ngf-max-size="1MB">
                                    Select File</button>
                                <br><br>
                                File:
                                <div style="font:smaller">{{f.name}} {{errFile.name}} {{errFile.$error}} {{errFile.$errorParam}}
                                    <span class="progress" ng-show="f.progress >= 0">
                                        <div style="width:{{f.progress}}%"  
                                             ng-bind="f.progress + '%'" ></div>
                                    </span>
                                </div>     
                                {{errorMsg}}
                            </div>
                            <div class="aa-single-submit mg-bseven">
                                <button class="btn btn-primary" type="submit" value="Update profile"  ng-disabled="updateprofileForm.$invalid || fileselected" >Update Profile</button>                  
                            </div>
                        </form>

输入一个有效的用户名

全名: 输入一封有效的电子邮件

电邮:

输入一个10个字符的密码

密码: 输入确认密码

密码不匹配

确认密码: 输入有效的电话号码

手机号码: 请选择一个国家/地区

国家: 请选择一个城市

城市: 选择文件

文件: {{f.name}{{errFile.name}{{{errFile.$error}}{{errFile.$errorParam}} {{errorMsg}} 更新配置文件
从以下行中删除所需的

<input class="form-control" id="pwd" type="password" ng-model="profileData.password" name="password" ng-minlength="10" ng-maxlength="40" required>

现在,如果我填写密码字段但不确认密码,则不会显示错误