PHP Classes

File: public/js/Signin.signup.js

Recommend this page to a friend!
  Classes of harold rita  >  CodeIgniter Template Viewer Class  >  public/js/Signin.signup.js  >  Download  
File: public/js/Signin.signup.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CodeIgniter Template Viewer Class
Render views using templates in a CodeIgniter App
Author: By
Last change:
Date: 4 months ago
Size: 2,332 bytes
 

Contents

Class file image Download
          $(function() {
           $('#formsignup').submit(function(e){
            e.preventDefault();
            e.stopPropagation();

            var fname = $("#firstname").val();
            var lname = $("#lastname").val();
            var email = $("#email").val();
            var password = $("#password").val();
            var confirmPassword = $("#confirmPassword").val();

            

            if(password === confirmPassword){

                var url = "<?=site_url('signup');?>";
                  $.ajax({
                    url: url,
                    type: "POST",
                      data: 'firstname='+fname+'&lastname='+lname+'&email='+email+'&password='+password+'&confirmPassword='+confirmPassword,
                      dataType: "html",
                    success: function(data){
                      /*$('.signuperror').html(''); 
                      $('.signuperror').addClass('alert alert-success'); 
                      $('.signuperror').append(email);*/
                      alert(data);
                      return false;
                    }
                  });

            }else{
               $('.signuperror').html('<i class="alert alert-warning">Sorry! Password do not match.</i>')
               return false;
            }
           });
            $('#confirmPassword').keyup(function(){
                var p = $('#password').val();
                var cp = $('#confirmPassword').val();
                if(cp === ""){
                    $('#password').removeClass('red');
                    $('#confirmPassword').removeClass('red');
                }
                else if(p === cp){
                    $('#password').removeClass('red');
                    $('#confirmPassword').removeClass('red');
                }else{
                    $('#password').addClass('red');
                    $('#confirmPassword').addClass('red');

                }
            });

            $('#password').keyup(function(){
                var p = $('#password').val();
                var cp = $('#confirmPassword').val();
                if(p === ""){
                    $('#password').removeClass('red');
                    $('#confirmPassword').removeClass('red');
                    $('#confirmPassword').val('');
                }
            });

        });
For more information send a message to info at phpclasses dot org.