2017-03-02 9 views
-2

で検証をangularjs私はangularjsに新しいですすべては私が私のHTMLはここにある。このコードで間違っているところ、誰かが教えてください:はHI形

<div class="form"> 
    <div id="signup"> 
     <h1>Welcome Back!</h1> 
     <form action="/" name="loginForm" method="post" ng-submit="sendLoginData()> 
     <div class="field-wrap"> 
      <input type="email"required autocomplete="off" name="userEmail" ng-model="user.name" placeholder="E-mail" required/> 
      <p ng-show="loginForm.userEmail.$error.required">Please Enter Your E-mail</p> 
     </div> 
     <div class="field-wrap"> 
      <input type="password"required autocomplete="off" name="userPassword" ng-model="user.password" placeholder="Password" required/> 
      <p ng-show="loginForm.userPassword.$error.required">Please Enter Your Password</p> 
     </div> 
     <span class="forgot"><a href ="#sign-up">Sign up</a></span> 
     <p class="forgot"><a href="#forgotpassword">Forgot Password?</a></p> 
     <input type="submit" class="button button-block" ng-disabled="loginForm.$invalid" value="Log IN"/> 
     </form> 
    </div> 
</div> 
+1

であなたのコードを置き換えることができますこのコードであなたの問題を説明してください –

+0

あなたは2つのフィールドに「必要」が2回あります。また、(type = "email"が必要)などのスペースの問題もあります。 – rrd

+0

まだ閉じていないng-submit = "sendLoginData()の構文エラーがあります。** ng-submit =" sendLoginData() "** –

答えて

0

あなたはこの

<div class="form"> 
     <div id="signup"> 
      <h1>Welcome Back!</h1> 
      <form action="/" name="loginForm" method="post" ng-submit="sendLoginData()"> 
      <div class="field-wrap"> 
       <input type="email"required autocomplete="off" name="userEmail" ng-model="user.name" placeholder="E-mail" required/> 
       <p ng-show="loginForm.userEmail.$touched && loginForm.userEmail.$error.required">Please Enter Your E-mail</p> 
      </div> 
      <div class="field-wrap"> 
       <input type="password"required autocomplete="off" name="userPassword" ng-model="user.password" placeholder="Password" required/> 
       <p ng-show="loginForm.userPassword.$touched && loginForm.userPassword.$error.required">Please Enter Your Password</p> 
      </div> 
      <span class="forgot"><a href ="#sign-up">Sign up</a></span> 
      <p class="forgot"><a href="#forgotpassword">Forgot Password?</a></p> 
      <input type="submit" class="button button-block" ng-disabled="loginForm.$invalid" value="Log IN"/> 
      </form> 
     </div> 
    </div> 
+0

まだ動作していません –

関連する問題