Plugin Directory

Changeset 2207393


Ignore:
Timestamp:
12/06/2019 07:47:37 PM (6 years ago)
Author:
verifybee
Message:

wp fluent validation fixed

Location:
form-verification-verifybee/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • form-verification-verifybee/trunk/README.txt

    r2207015 r2207393  
    55Requires at least: 3.0.1
    66Tested up to: 5.3
    7 Stable tag: 1.3
     7Stable tag: 1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6767
    6868== Changelog ==
     69= 1.4 =
     70*   wp fluent validation fixed
    6971
    7072= 1.3 =
  • form-verification-verifybee/trunk/includes/class-cn-verifying-email.php

    r2206873 r2207393  
    192192
    193193        $this->loader->add_action('frm_validate_field_entry', $plugin_public, 'cn_verifying_formidable',10, 4);
     194
     195        $this->loader->add_action('fluentform_before_insert_submission', $plugin_public, 'cn_fluent_validation', 10, 3 );
    194196       
    195197
    196         // $this->loader->add_action('cn_fluent_validation', 'fluent_validation', 10, 3 );
    197 
    198         //$this->loader->add_action('fluentform_before_insert_submission', 'fluent_validation', 10, 2 );
     198       
    199199    }
    200200
  • form-verification-verifybee/trunk/public/class-cn-verifying-email-public.php

    r2206873 r2207393  
    227227    }
    228228
     229    public function cn_fluent_validation($insertData, $data, $formId){
     230        // $insertData, $data, $formId
     231        $insertData;
     232        $value= $data['email'];
     233        $cn_verification=get_option('cn_verification');
     234        $cn_token=wp_kses(get_option('cn_token'), []);
     235        $your_email = sanitize_email($value);
     236        $error_message = $this->validate_email($cn_token, $cn_name, $your_email);
     237        if($error_message) {
     238            wp_send_json(['errors' => ['restricted' => [$error_message]]], 422);
     239        }
     240
     241    }
     242
    229243   
    230244   
  • form-verification-verifybee/trunk/public/js/cn-verifying-email-public.js

    r2205629 r2207393  
    11(function( $ ) {
    22    'use strict';
    3     $( document ).ready(function() {
    4         $('.ff-btn-submit').click(function(event) {
    5             event.preventDefault();             
    6             $('.cnvalidation').remove();
    7             var form_id=$('.frm-fluent-form').attr('data-form_id');
    8             var cnform_id=$('.frm-fluent-form').attr('id');
    9             var cndata=$('.frm-fluent-form :input').serialize();
    10             var cnemail =$("input[type='email']").val();
    11             if (cnemail) {
    12                 jQuery.post(cn_verifying_plugin_vars.ajaxurl,{
    13                     'action': 'Cn_Verifying_public_quiz_ajax',
    14                     'param': 'fluent_validation',
    15                     'cnemail':cnemail
    16                 }, function(response){
    17                     var newResponse = JSON.parse(response)
    18                     if (newResponse.message) {
    19                         var cnemail =$("input[type='email']").val();
    20                         $("input[type='email']").parent().after("<div class='cnvalidation' style='color:red;margin-bottom: 10px;'>"+newResponse.message+"</div>");
    21                     }
    22                     if (newResponse.is_valid=='done') {
    23                         $('.ff-btn-submit').parent().append('<div class="ff-loading"></div>');
    24                         jQuery.post(cn_verifying_plugin_vars.ajaxurl,{
    25                             'action': 'fluentform_submit',
    26                             'data':cndata,
    27                             'form_id':form_id
    28                         }, function(response){
    29                             if (response.data.result.action=='reset_form') {
    30                                 $('.frm-fluent-form :input,textarea').val('');
    31                             }else{
    32                                 $('.frm-fluent-form').hide();
    33                             }
    34                             $('.ff-loading').remove();
    35                             $(".frm-fluent-form").parent().after("<div id='fluentform_1_success' class='ff-message-success'>"+response.data.result.message+"</div>");
     3    // $( document ).ready(function() {
     4    // $('.ff-btn-submit').click(function(event) {
     5 //             event.preventDefault();             
     6 //             $('.cnvalidation').remove();
     7 //             var form_id=$('.frm-fluent-form').attr('data-form_id');
     8 //             var cnform_id=$('.frm-fluent-form').attr('id');
     9    //      var cndata=$('.frm-fluent-form :input').serialize();
     10    //      var cnemail =$("input[type='email']").val();
     11    //      if (cnemail) {
     12    //          jQuery.post(cn_verifying_plugin_vars.ajaxurl,{
     13    //              'action': 'Cn_Verifying_public_quiz_ajax',
     14    //              'param': 'fluent_validation',
     15    //              'cnemail':cnemail
     16    //          }, function(response){
     17    //              var newResponse = JSON.parse(response)
     18    //              if (newResponse.message) {
     19    //                  var cnemail =$("input[type='email']").val();
     20    //                  $("input[type='email']").parent().after("<div class='cnvalidation' style='color:red;margin-bottom: 10px;'>"+newResponse.message+"</div>");
     21    //              }
     22    //              if (newResponse.is_valid=='done') {
     23    //                  $('.ff-btn-submit').parent().append('<div class="ff-loading"></div>');
     24    //                  jQuery.post(cn_verifying_plugin_vars.ajaxurl,{
     25    //                      'action': 'fluentform_submit',
     26    //                      'data':cndata,
     27    //                      'form_id':form_id
     28    //                  }, function(response){
     29    //                      if (response.data.result.action=='reset_form') {
     30    //                          $('.frm-fluent-form :input,textarea').val('');
     31    //                      }else{
     32    //                          $('.frm-fluent-form').hide();
     33    //                      }
     34    //                      $('.ff-loading').remove();
     35    //                      $(".frm-fluent-form").parent().after("<div id='fluentform_1_success' class='ff-message-success'>"+response.data.result.message+"</div>");
    3636                           
    37                         });
    38                     }
     37    //                  });
     38    //              }
    3939                   
    40                 });
    41             }else{
    42                 $("input[type='email']").parent().after("<div class='cnvalidation' style='color:red;margin-bottom: 10px;'>This field is required</div>");
    43             }
     40    //          });
     41    //      }else{
     42    //          $("input[type='email']").parent().after("<div class='cnvalidation' style='color:red;margin-bottom: 10px;'>This field is required</div>");
     43    //      }
    4444           
    4545
    4646
    4747
    48         });
     48    // });
    4949       
    50     })
     50    // })
    5151
    5252})( jQuery );
Note: See TracChangeset for help on using the changeset viewer.