Rev 3639 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?php$routeSignin = $this->url('signin');$this->inlineScript()->captureStart();echo <<<JSfunction enableBtn(){document.getElementById("btn-submit").disabled = false;}jQuery( document ).ready(function( $ ) {$.validator.addMethod('passwordStrengthCheck', function(value) {return /^(?=.*\d+)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{6,16}$/.test(value)}, 'ERROR_PASSWORD_STRENGTH');$.validator.setDefaults({debug: true,highlight: function(element) {$(element).closest('.sn-field').addClass('sn-field-has-error');},unhighlight: function(element) {$(element).closest('.sn-field').removeClass('sn-field-has-error');},errorElement: 'div',errorClass: 'sn-field-invalid-feedback',errorPlacement: function(error, element) {console.log(element);if(element.parent('.sn-field').length) {error.insertAfter(element.parent());} else if (element.parent('.fgt-sec').length) {error.insertAfter(element.parent());} else {error.insertAfter(element);}}});$.fn.showFormErrorValidator = function(fieldname, errors) {var field = $(fieldname);if(field) {$(field).closest('.sn-field').addClass('sn-field-has-error');var error = $('<div id="' + fieldname +'-error" class="sn-field-invalid-feedback">' + errors + '</div>');if(field.parent('.sn-field').length) {error.insertAfter(field.parent());} else if (field.parent('.fgt-sec').length) {error.insertAfter(field.parent());} else {error.insertAfter(field);}}};var validatorSignup = $('#form-signup').validate({debug: true,onclick: false,onkeyup: false,ignore: [':hidden'],rules: {'first_name': {required: true,maxlength: 64,},'last_name': {required: true,maxlength: 64,},'email': {required: true,email: true,maxlength: 250,},'password': {required: true,minlength: 6,maxlength: 16,passwordStrengthCheck: true,},'confirmation' : {required: true,minlength: 6,maxlength: 16,equalTo: '#form-signup #password'},'terms_and_conditions' : {required: true,}},submitHandler: function(form){if (grecaptcha.getResponse() == '') {$.fn.showError('ERROR_RECAPTCHA_EMPTY');return false;}NProgress.start();$.ajax({'dataType' : 'json','accept' : 'application/json','method' : 'post','url' : $('#form-signup').attr('action'),'data' : $('#form-signup').serialize()}).done(function(response) {if(response.success) {window.location.href = '$routeSignin';} else {if(jQuery.type(response.data) == 'string') {$.fn.showError(response.data)} else {$.each(response.data, function( fieldname, errors ) {$.fn.showFormErrorValidator('#form-signup #' + fieldname, errors);});}}}).fail(function( jqXHR, textStatus, errorThrown) {$.fn.showError(textStatus)}).always(function() {NProgress.done();grecaptcha.reset();})},invalidHandler: function(form, validator) {}});// $(function() {// var pass= $("#password").passwordStrength();//console.log(pass);// });});JS;$this->inlineScript()->captureEnd();?><div class="signin-popup"><div class="signin-pop"><div class="row"><div class="col-lg-6"><div class="cmp-info"><div class="cm-logo"><img src="<?php echo $this->networkLogoHelper() ?>" alt=""><?php echo $this->networkIntroHelper() ?></div><!--cm-logo end--></div><!--cmp-info end--></div><div class="col-lg-6"><div class="login-sec"><ul class="sign-control"><li><a href="<?php echo $this->url('signin') ?>" title="">LABEL_SIGNIN</a></li><li class="current"><a href="#" title="">LABEL_SIGNUP</a></li><li><a href="<?php echo $this->url('forgot-password') ?>" title="">LABEL_FORGOT_MY_PASSWORD</a></li></ul><div class="sign_in_sec current"><h3>LABEL_SIGNUP</h3><?php$form = $this->form;$form->setAttributes(['method' => 'post','action' => $this->url('signup'),'name' => 'form-signup','id' => 'form-signup']);$form->prepare();echo $this->form()->openTag($form);?><div class="row"><div class="col-lg-12 no-pdd"><div class="sn-field"><?php$element = $form->get('email');$element->setAttributes(['placeholder' => 'LABEL_EMAIL',]);echo $this->formText($element);?><i class="la la-envelope"></i></div><!--sn-field end--></div><div class="col-lg-12 no-pdd"><div class="sn-field"><?php$element = $form->get('first_name');$element->setAttributes(['placeholder' => 'LABEL_FIRST_NAME',]);echo $this->formText($element);?><i class="la la-user"></i></div></div><div class="col-lg-12 no-pdd"><div class="sn-field"><?php$element = $form->get('last_name');$element->setAttributes(['placeholder' => 'LABEL_LAST_NAME',]);echo $this->formText($element);?><i class="la la-user"></i></div></div><div class="col-lg-12 no-pdd"><div class="sn-field"><?php$element = $form->get('password');$element->setAttributes(['placeholder' => 'LABEL_PASSWORD',]);echo $this->formPassword($element);?><i class="la la-lock"></i></div></div><div class="col-lg-12 no-pdd"><div class="sn-field"><?php$element = $form->get('confirmation');$element->setAttributes(['placeholder' => 'LABEL_CONFIRMATION',]);echo $this->formPassword($element);?><i class="la la-lock"></i></div></div><div class="col-lg-12 no-pdd"><div class="checky-sec st2"><div class="sn-field fgt-sec"><?php$element = $form->get('terms_and_conditions');echo $this->formCheckbox($element);?><label for="terms_and_conditions"><span></span></label><small>LABEL_ACCEPT_TERMS_AND_CONDITIONS</small></div><!--fgt-sec end--></div></div><div class="col-lg-12 no-pdd"><div class="sn-field"><?php$element = $form->get('captcha');echo $this->formRow($element);?></div></div><div class="col-lg-12 no-pdd"><button type="submit" value="submit" id="btn-submit" disabled="disabled" >LABEL_SIGNUP</button></div></div><?php echo $this->form()->closeTag($form); ?></div></div></div></div></div></div>