Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angularjs form validation on submit

<div class="container" ng-app>

  <h1><span><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/15309/angular-logo.svg" alt="Angular.js Logo" /></span> Angular.js - Web Form</h1>

  <form role="form" name="form" id="contact-form" novalidate>
    <div class="form-group">
      <label for="FirstName">First name</label>
      <input type="text" class="form-control" name="FirstName" id="FirstName" placeholder="enter first name" ng-model="firstName" required>
    </div>

    <div class="form-group">
      <label for="LastName">Last Name</label>
      <input type="text" class="form-control" name="LastName" id="LastName" placeholder="enter last name" ng-model="lastName" required>
    </div>

    <div class="form-group">
      <label for="EmailAddress">Email address</label>
      <input type="email" class="form-control" id="EmailAddress" name="EmailAddress" placeholder="enter email" ng-model="emailAddress" ng-model-options="{ updateOn: 'blur' }" required>
    </div>

    <div class="checkbox">
      <label>
        <input type="checkbox" required> Check me out
      </label>
    </div>


    <button type="submit" class="btn btn-default" ng-disabled="form.$invalid">Submit</button>

  </form>

</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: detect scroll height 
Javascript :: javascript select2 sortable 
Javascript :: simple nodejs server 
Javascript :: javascript closure interview questions 
Javascript :: print js css not working 
Javascript :: JavaScript Sorting Arrays 
Javascript :: double ?? js 
Javascript :: obfuscate js string 
Javascript :: delete request reaxt 
Javascript :: send sms with twilio 
Javascript :: if event keycode and click 
Javascript :: rewrite expressjs url 
Javascript :: image and video lightbox react 
Javascript :: multiple forms formData js 
Javascript :: click binding angular 8 
Javascript :: react use component 
Javascript :: print stuff in console javascript 
Javascript :: splice remove 0 elements before index and insert new element 
Javascript :: How to change height of bottom material tab navigator from react-naviagtion 
Javascript :: postman environment variable 
Javascript :: how to get lastchar in string in js 
Javascript :: leaflet update marker icon 
Javascript :: Merging Or Copying Arrays Using Spread Operator 
Javascript :: how to uninstall nodejs web server 
Javascript :: send data using axios 
Javascript :: iterate table in jquery 
Javascript :: check property exists in object javascript 
Javascript :: carousel in material ui react 
Javascript :: scroll top javascript 
Javascript :: how to get current time using moment 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =