SHARE
TWEET
Untitled
a guest
Oct 3rd, 2016
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- <section class="global_registration" ng-app="registration" ng-controller="RegistrationController">
- <form name="registration" ng-submit="register()" ngnovalidate>
- <input type="text" name="username" id="username" placeholder="Username" ng-model="user.username" ng-required="true" ng-pattern="/^[a-zA-Z0-9]*$/"></br>
- <p ng-show="registration.username.$touched && registration.username.$error.required">Please enter a Username!</p>
- <p ng-show="registration.username.$error.pattern">Please enter a Valid Username (No special characters)!</p>
- <input type="email" name="email" id="email" placeholder="Email" ng-model="user.email" ng-required="true" ng-pattern="/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/"></br>
- <p ng-show="registration.email.$invalid && registration.email.$touched">Please enter a valid email!</p>
- <input type="password" name="password1" id="password1" placeholder="Password" ng-model="user.password1" ng-required="true" ng-minlength="6"></br>
- <p ng-show="registration.password1.$invalid && registration.password1.$touched">Passwords must be at least 6 characters!</p>
- <input type="password" name="password2" id="password2" placeholder="Confirm Password" ng-model="user.password2" ng-required="true" ng-minlength="6"></br>
- <p ng-show="registration.password2.$invalid && registration.password2.$touched">Passwords must be at least 6 characters!</p>
- <input type="submit">
- </form>
- </section>
- <script>
- var registration = angular.module('registration');
- registration.controller('RegistrationController', ['$scope',
- function($scope){
- $scope.register = function(){
- $.ajax({
- type: "POST",
- url: 'registration_validate.php',
- data:{username, email, password1, password2 },
- success: function(data)
- {
- alert(data);
- event.preventDefault();
- }
- })
- };
- }
- ]);
- </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
