Metform Elementor Contact Form Builder – Flexible and Design-Friendly Contact Form builder plugin for WordPress - Version 1.1.5

Version Description

Download this release

Release Info

Developer ataurr
Plugin Icon 128x128 Metform Elementor Contact Form Builder – Flexible and Design-Friendly Contact Form builder plugin for WordPress
Version 1.1.5
Comparing to
See all releases

Code changes from version 1.1.4 to 1.1.5

controls/assets/css/form-picker-editor.css CHANGED
@@ -44,6 +44,7 @@
44
  padding: 3px;
45
  display: block;
46
  }
47
- .elementor-editor-active .formpicker_warper_editable .formpicker_warper_editable .formpicker_warper_edit {
 
48
  display: none!important;
49
  }
44
  padding: 3px;
45
  display: block;
46
  }
47
+ .elementor-editor-active .formpicker_warper_editable .formpicker_warper_editable .formpicker_warper_edit,
48
+ .elementor-widget-metform .elementor-element-overlay {
49
  display: none!important;
50
  }
core/entries/action.php CHANGED
@@ -287,24 +287,27 @@ Class Action{
287
  }
288
  }
289
 
290
- if(isset($this->form_settings['store_entries']) && $this->form_settings['store_entries'] == 1){
291
-
292
- $this->store($form_id, $form_data);
293
-
294
- }
295
 
296
- if(class_exists('\MetForm\Core\Integrations\Slack') && isset($this->form_settings['mf_rest_api']) && ($this->form_settings['mf_rest_api_url'] != '')){
297
  $url = $this->form_settings['mf_rest_api_url'];
 
298
  $rest_api = new \MetForm\Core\Integrations\Rest_Api();
299
- $response = $rest_api->call_api( $this->form_data, ['url' => $url] );
300
- $this->response->data['rest'] = $response['msg'];
301
- //$this->response->status = isset($response['status']) ? $response['status'] : 0;
 
 
 
 
 
 
 
 
 
 
302
  }
303
 
304
- // get form data from postmeta for sending formated mail to respective user
305
- $this->inserted_form_data = get_post_meta( $this->entry_id, 'metform_entries__form_data', true);
306
- $this->inserted_form_data = (isset($this->inserted_form_data)) ? $this->inserted_form_data : "";
307
-
308
  $file_input_names = $this->get_file_input_name();
309
  if( (!empty($file_data)) && ($file_input_names != null)){
310
  $this->upload_file($file_data, $file_input_names);
@@ -312,13 +315,13 @@ Class Action{
312
 
313
  if(isset($this->form_settings['enable_user_notification']) && $this->form_settings['enable_user_notification'] == 1){
314
 
315
- $this->send_user_email($this->inserted_form_data);
316
 
317
  }
318
 
319
  if(isset($this->form_settings['enable_admin_notification']) && $this->form_settings['enable_admin_notification'] == 1){
320
 
321
- $this->send_admin_email($this->inserted_form_data);
322
  }
323
 
324
  $this->response->data['message'] = $this->form_settings['success_message'];
@@ -423,11 +426,13 @@ Class Action{
423
  $this->sanitize($form_data);
424
  $this->entry_id = $entry_id;
425
 
426
- if( $this->entry_id == null ){
427
- $this->insert();
428
- }
429
- else {
430
- $this->update();
 
 
431
  }
432
 
433
  }
@@ -458,6 +463,15 @@ Class Action{
458
  }
459
 
460
  }
 
 
 
 
 
 
 
 
 
461
 
462
  }
463
 
@@ -489,16 +503,6 @@ Class Action{
489
  $entry_count = $this->get_entry_count();
490
  $entry_count++;
491
 
492
- $repeaters = $this->get_repeater_input_name();
493
-
494
- $repeaters = (is_array($repeaters) ? $repeaters : []);
495
-
496
- foreach( $repeaters as $repeater ){
497
- //$repeater_form_data = $this->form_data[$repeater];
498
- $repeater_process_data = $this->process_repeater_data( $this->form_data[$repeater] );
499
- $this->form_data[$repeater] = $repeater_process_data;
500
- }
501
-
502
  update_post_meta( $form_id, $this->key_form_total_entries, $entry_count );
503
  update_post_meta( $this->entry_id, $this->key_form_id, $form_id );
504
  update_post_meta( $this->entry_id, $this->key_form_data, $this->form_data );
287
  }
288
  }
289
 
290
+ $this->store( $form_id, $form_data );
 
 
 
 
291
 
292
+ if(class_exists('\MetForm\Core\Integrations\Rest_Api') && isset($this->form_settings['mf_rest_api']) && ($this->form_settings['mf_rest_api_url'] != '')){
293
  $url = $this->form_settings['mf_rest_api_url'];
294
+ $method = $this->form_settings['mf_rest_api_method'];
295
  $rest_api = new \MetForm\Core\Integrations\Rest_Api();
296
+ $response = $rest_api->call_api(
297
+ [
298
+ 'entries' => json_encode($this->form_data),
299
+ 'entry_id' => ( ( $this->entry_id != null ) ? $this->entry_id : ''),
300
+ 'form_id' => $form_data['id'],
301
+ 'version' => \MetForm\Plugin::instance()->version()
302
+ ],
303
+ [
304
+ 'url' => $url,
305
+ 'method' => $method
306
+ ]
307
+ );
308
+ $this->response->status = isset($response['status']) ? $response['status'] : 0;
309
  }
310
 
 
 
 
 
311
  $file_input_names = $this->get_file_input_name();
312
  if( (!empty($file_data)) && ($file_input_names != null)){
313
  $this->upload_file($file_data, $file_input_names);
315
 
316
  if(isset($this->form_settings['enable_user_notification']) && $this->form_settings['enable_user_notification'] == 1){
317
 
318
+ $this->send_user_email($this->form_data);
319
 
320
  }
321
 
322
  if(isset($this->form_settings['enable_admin_notification']) && $this->form_settings['enable_admin_notification'] == 1){
323
 
324
+ $this->send_admin_email($this->form_data);
325
  }
326
 
327
  $this->response->data['message'] = $this->form_settings['success_message'];
426
  $this->sanitize($form_data);
427
  $this->entry_id = $entry_id;
428
 
429
+ if(isset($this->form_settings['store_entries']) && $this->form_settings['store_entries'] == 1){
430
+ if( $this->entry_id == null ){
431
+ $this->insert();
432
+ }
433
+ else {
434
+ $this->update();
435
+ }
436
  }
437
 
438
  }
463
  }
464
 
465
  }
466
+
467
+ $repeaters = $this->get_repeater_input_name();
468
+
469
+ $repeaters = (is_array($repeaters) ? $repeaters : []);
470
+
471
+ foreach( $repeaters as $repeater ){
472
+ $repeater_process_data = $this->process_repeater_data( $this->form_data[$repeater] );
473
+ $this->form_data[$repeater] = $repeater_process_data;
474
+ }
475
 
476
  }
477
 
503
  $entry_count = $this->get_entry_count();
504
  $entry_count++;
505
 
 
 
 
 
 
 
 
 
 
 
506
  update_post_meta( $form_id, $this->key_form_total_entries, $entry_count );
507
  update_post_meta( $this->entry_id, $this->key_form_id, $form_id );
508
  update_post_meta( $this->entry_id, $this->key_form_data, $this->form_data );
core/entries/map-el.php CHANGED
@@ -41,6 +41,10 @@ Class Map_El{
41
  'mf_input_label' => ( isset($v->settings->mf_input_label) ? $v->settings->mf_input_label: '' ) ,
42
  'mf_input_name' => ( isset($v->widgetType) ? $v->widgetType : '' ),
43
  'mf_input_placeholder' => ( isset($v->settings->mf_input_placeholder) ? $v->settings->mf_input_placeholder : '' ),
 
 
 
 
44
  'widgetType' => ( isset($v->widgetType) ? $v->widgetType : '' ),
45
  ];
46
  }
41
  'mf_input_label' => ( isset($v->settings->mf_input_label) ? $v->settings->mf_input_label: '' ) ,
42
  'mf_input_name' => ( isset($v->widgetType) ? $v->widgetType : '' ),
43
  'mf_input_placeholder' => ( isset($v->settings->mf_input_placeholder) ? $v->settings->mf_input_placeholder : '' ),
44
+ 'mf_input_min_length' => ( isset($v->settings->mf_input_min_length) ? $v->settings->mf_input_min_length : '' ),
45
+ 'mf_input_max_length' => ( isset($v->settings->mf_input_max_length) ? $v->settings->mf_input_max_length : '' ),
46
+ 'mf_input_validation_type' => ( isset($v->settings->mf_input_validation_type) ? $v->settings->mf_input_validation_type : '' ),
47
+ 'mf_input_validation_expression' => ( isset($v->settings->mf_input_validation_expression) ? $v->settings->mf_input_validation_expression : '' ),
48
  'widgetType' => ( isset($v->widgetType) ? $v->widgetType : '' ),
49
  ];
50
  }
core/entries/meta-data.php CHANGED
@@ -173,10 +173,10 @@ Class Meta_Data{
173
  $file_url = isset($value['url']) ? $value['url'] : '';
174
  $file_type = isset($value['type']) ? $value['type'] : '';
175
  if ( $file_url != '' ) {
176
- echo esc_html((($this->fields[$key]->mf_input_label != '') ? $this->fields[$key]->mf_input_label : $key )." : ")."<a target='_blank' class='mf-file-url' href=".esc_url($file_url).">". esc_html__('Download', 'elementskit') ."</a>";
177
  echo ((in_array($file_type, ['image/jpeg', 'image/png', 'image/jpg', 'image/gif', 'image/ico'])) ? ' | <a href="#" class="" data-toggle="modal" data-target="#mfFileUploadModal'.$key.'">'.esc_html__('View', 'metform').'</a>' : '');
178
  }else{
179
- echo esc_html((($this->fields[$key]->mf_input_label != '') ? $this->fields[$key]->mf_input_label : $key )." : ").esc_html__('This file is not uploaded.', 'metform');
180
  }
181
 
182
  ?>
173
  $file_url = isset($value['url']) ? $value['url'] : '';
174
  $file_type = isset($value['type']) ? $value['type'] : '';
175
  if ( $file_url != '' ) {
176
+ echo esc_html(((isset($this->fields[$key]->mf_input_label)) ? $this->fields[$key]->mf_input_label : $key )." : ")."<a target='_blank' class='mf-file-url' href=".esc_url($file_url).">". esc_html__('Download', 'elementskit') ."</a>";
177
  echo ((in_array($file_type, ['image/jpeg', 'image/png', 'image/jpg', 'image/gif', 'image/ico'])) ? ' | <a href="#" class="" data-toggle="modal" data-target="#mfFileUploadModal'.$key.'">'.esc_html__('View', 'metform').'</a>' : '');
178
  }else{
179
+ echo esc_html(((isset($this->fields[$key]->mf_input_label)) ? $this->fields[$key]->mf_input_label : $key )." : ").esc_html__('This file is not uploaded.', 'metform');
180
  }
181
 
182
  ?>
core/forms/action.php CHANGED
@@ -111,9 +111,9 @@ Class Action{
111
  $this->response['saved'] = true;
112
  $this->response['status'] = esc_html('Form settings updated','metform');
113
 
114
- if((!array_key_exists('store_entries',$this->form_setting)) && (!array_key_exists('enable_user_notification',$this->form_setting)) && (!array_key_exists('enable_admin_notification',$this->form_setting)) && (!array_key_exists('mf_mail_chimp',$this->form_setting)) && (!array_key_exists('mf_zapier',$this->form_setting))){
115
  $this->response['saved'] = false;
116
- $this->response['status'] = esc_html('You must active at least one field of these fields "store entry/ Confirmation/ Notification/ MailChimp/ Zapier". ','metform');
117
  }
118
 
119
  $this->response['data']['id'] = $this->form_id;
111
  $this->response['saved'] = true;
112
  $this->response['status'] = esc_html('Form settings updated','metform');
113
 
114
+ if((!array_key_exists('store_entries',$this->form_setting)) && (!array_key_exists('enable_user_notification',$this->form_setting)) && (!array_key_exists('enable_admin_notification',$this->form_setting)) && (!array_key_exists('mf_mail_chimp',$this->form_setting)) && (!array_key_exists('mf_zapier',$this->form_setting)) && (!array_key_exists('mf_rest_api', $this->form_setting)) && (!array_key_exists('mf_slack', $this->form_setting))){
115
  $this->response['saved'] = false;
116
+ $this->response['status'] = esc_html('You must active at least one field of these fields "store entries/ Confirmation/ Notification/ REST API/ MailChimp/ Slack/ Zapier". ','metform');
117
  }
118
 
119
  $this->response['data']['id'] = $this->form_id;
core/forms/cpt.php CHANGED
@@ -98,6 +98,9 @@ Class Cpt extends \MetForm\Base\Cpt{
98
  'mf_rest_api_url' => [
99
  'name' => 'mf_rest_api_url',
100
  ],
 
 
 
101
  'mf_mailchimp_api_key' => [
102
  'name' => 'mf_mailchimp_api_key',
103
  ],
98
  'mf_rest_api_url' => [
99
  'name' => 'mf_rest_api_url',
100
  ],
101
+ 'mf_rest_api_method' => [
102
+ 'name' => 'mf_rest_api_method',
103
+ ],
104
  'mf_mailchimp_api_key' => [
105
  'name' => 'mf_mailchimp_api_key',
106
  ],
core/forms/views/modal-editor.php CHANGED
@@ -184,18 +184,29 @@
184
  <div class="attr-modal-body" id="metform_form_modal_body">
185
 
186
  <?php if(class_exists('\MetForm\Core\Integrations\Rest_Api')): ?>
187
- <div class="mf-input-group">
188
  <label class="attr-input-label">
189
  <input type="checkbox" value="1" name="mf_rest_api" class="mf-admin-control-input mf-form-modalinput-rest_api">
190
  <span><?php esc_html_e('REST API:', 'metform'); ?></span>
191
  </label>
192
- <span class='mf-input-help'><?php esc_html_e('Submit this form submission to a api/ url','metform'); ?></span>
193
  </div>
194
  <br>
195
- <div class="mf-input-group mf-rest-api">
196
- <label for="attr-input-label" class="attr-input-label"><?php esc_html_e('REST API url:', 'metform'); ?></label>
197
- <input type="text" name="mf_rest_api_url" class="mf-rest-api-url attr-form-control" placeholder="<?php esc_html_e('Rest api url', 'metform');?>">
198
- <span class='mf-input-help'><?php esc_html_e('Enter here rest api url.','metform'); ?></span>
 
 
 
 
 
 
 
 
 
 
 
199
  </div>
200
  <br>
201
  <?php endif ?>
184
  <div class="attr-modal-body" id="metform_form_modal_body">
185
 
186
  <?php if(class_exists('\MetForm\Core\Integrations\Rest_Api')): ?>
187
+ <div class="mf-input-group mf-input-group-inner">
188
  <label class="attr-input-label">
189
  <input type="checkbox" value="1" name="mf_rest_api" class="mf-admin-control-input mf-form-modalinput-rest_api">
190
  <span><?php esc_html_e('REST API:', 'metform'); ?></span>
191
  </label>
192
+ <span class='mf-input-help'><?php esc_html_e('Send entry data to third party api/webhook','metform'); ?></span>
193
  </div>
194
  <br>
195
+ <div class="mf-input-rest-api-group">
196
+ <div class="mf-input-group mf-rest-api">
197
+ <label for="attr-input-label" class="attr-input-label"><?php esc_html_e('URL/Webhook:', 'metform'); ?></label>
198
+ <input type="text" name="mf_rest_api_url" class="mf-rest-api-url attr-form-control" placeholder="<?php esc_html_e('Rest api url/webhook', 'metform');?>">
199
+ <span class='mf-input-help'><?php esc_html_e('Enter rest api url/webhook here.','metform'); ?></span>
200
+ </div>
201
+ <div class="mf-input-group mf-rest-api-key">
202
+ <div class="mf-input-group" id='rest_api_method'>
203
+ <select name="mf_rest_api_method" class="mf-rest-api-method attr-form-control" >
204
+ <option value="POST"><?php esc_html_e('POST', 'metform'); ?></option>
205
+ <option value="GET"><?php esc_html_e('GET', 'metform'); ?></option>
206
+ </select>
207
+ </div>
208
+ </div>
209
+
210
  </div>
211
  <br>
212
  <?php endif ?>
core/integrations/rest-api.php CHANGED
@@ -3,20 +3,20 @@ namespace MetForm\Core\Integrations;
3
  defined( 'ABSPATH' ) || exit;
4
 
5
  Class Rest_Api{
6
- public function call_api( $form_data, $settings ){
7
  $msg = [];
8
-
9
- $status = wp_remote_post( $settings['url'], array(
10
- 'method' => 'POST',
11
  'timeout' => 30,
12
  'redirection' => 5,
13
  'httpversion' => '1.0',
14
  'blocking' => true,
15
  'headers' => array(),
16
- 'body' => json_encode($form_data),
17
  'cookies' => array()
18
- )
19
- );
 
20
 
21
  if(is_wp_error($status)){
22
  $msg['status'] = 0;
3
  defined( 'ABSPATH' ) || exit;
4
 
5
  Class Rest_Api{
6
+ public function call_api( $data, $settings ){
7
  $msg = [];
8
+
9
+ $args = [
 
10
  'timeout' => 30,
11
  'redirection' => 5,
12
  'httpversion' => '1.0',
13
  'blocking' => true,
14
  'headers' => array(),
15
+ 'body' => $data,
16
  'cookies' => array()
17
+ ];
18
+
19
+ $status = strtolower('wp_remote_'.$settings['method'])($settings['url'], $args);
20
 
21
  if(is_wp_error($status)){
22
  $msg['status'] = 0;
libs/assets/css/admin-style.css CHANGED
@@ -1,6 +1 @@
1
- .elementor-editor-active .metform-form-save-btn-editor{
2
- display: none!important;
3
- }
4
-
5
- .loading .attr-modal-content:before{opacity:.8;position:absolute;content:"";top:0;left:0;height:100%;width:100%;background-color:#fff;-webkit-transition:opaicty .5s ease;-o-transition:opaicty .5s ease;transition:opaicty .5s ease;z-index:5;border-radius:inherit}.loading .ekit-spinner{display:block}.attr-modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-top:30px;width:565px}.attr-modal-dialog-centered .attr-modal-header{padding:36px 50px;border-bottom:none}.attr-modal-dialog-centered .attr-modal-header .attr-modal-title{font-size:20px;font-weight:bold;color:#111111;text-transform:capitalize;margin-bottom:38px;line-height:1}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs{border:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs li{margin:0;float:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a{text-decoration:none;text-align:center;color:#111111;font-size:14px;text-transform:capitalize;font-weight:600;padding:8px 14px;border:none;margin-right:0;border:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a:hover{border:none;background-color:transparent}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a:focus{outline:none;-webkit-box-shadow:none;box-shadow:none;border:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs li.attr-active a{border:none;color:#ffffff;background-color:#1F55F8;border-radius:4px}.attr-modal-dialog-centered .attr-modal-header button.attr-close{opacity:.8;font-size:inherit;outline:none;margin-top:-15px;margin-right:-25px}.attr-modal-dialog-centered .attr-modal-header button.attr-close span{color:#e81123;font-size:35px;font-weight:100;background-color:#FCE7E9;height:36px;width:36px;display:inline-block;line-height:36px;border-radius:100px;outline:none;margin-top:5px;font-family:initial}.attr-modal-dialog-centered .attr-tab-content .attr-modal-body{padding:40px 50px;padding-top:0}.attr-modal-dialog-centered .attr-tab-content div#limit_status.hide_input{display:none}.attr-modal-dialog-centered .attr-tab-content .mf-input-group label.attr-input-label{color:#111111;font-size:16px;margin-bottom:7px;display:block;font-weight:500}.attr-modal-dialog-centered .attr-tab-content .mf-input-group{margin-bottom:14px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .attr-form-control,.attr-modal-dialog-centered .attr-tab-content .mf-input-group input{color:#555;font-size:14px;height:48px;padding:0 22px;border-color:#ededed;-webkit-box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);margin-top:12px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]{display:none}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span{position:relative;display:block}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:before{content:"No";width:55px;height:25px;background-color:#EDEDED;left:0;border-radius:15px;text-align:right;color:#fff;text-transform:uppercase;font-weight:bold;font-size:10px;padding:3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding-right:10px;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s;float:right;line-height:18px;cursor:pointer}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:after{content:"";width:20px;height:20px;background-color:#fff;border-radius:100px;display:inline-block;position:absolute;right:31px;top:2px;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]:checked+span:before{content:"Yes";width:55px;height:25px;background-color:#1F55F8;left:0;border-radius:15px;display:inline-block;text-align:left;color:#fff;text-transform:uppercase;font-weight:bold;font-size:10px;padding:3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:10px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]:checked+span:after{content:"";width:20px;height:20px;background-color:#fff;border-radius:100px;display:inline-block;position:absolute;right:2px;top:2px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group span.mf-input-help{color:#b7b7b7;font-style:italic;font-size:12px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group span.mf-input-help strong{color:red}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner label.attr-input-label{display:inline-block}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner #limit_status{width:100px;margin:0;position:relative;margin-left:15px;float:right;margin-top:-2px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input{margin:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]+span:before{position:relative;top:-2px;left:5px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]+span:after{right:28px;top:0px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]:checked+span:after{right:-2px;top:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=number]+span,.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=text]+span{display:block;margin-top:5px}.attr-modal-dialog-centered .attr-tab-content #limit_status.show_input{margin-top:32px}.attr-modal-dialog-centered .attr-modal-footer{padding:30px 50px}.attr-modal-dialog-centered .attr-modal-footer button{color:#fff;background-color:#1F55F8;font-size:16px;font-weight:bold;-webkit-box-sizing:border-box;box-sizing:border-box;padding:12px 20px;-webkit-box-shadow:none;box-shadow:none;border:1px solid transparent;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s;outline:none}.attr-modal-dialog-centered .attr-modal-footer button:focus{border:none;outline:none}.attr-modal-dialog-centered .attr-modal-footer button.metform-form-save-btn-editor{background-color:#d8d8d8;color:#111111}.attr-modal-dialog-centered>form{width:100%}.modal-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5)}.modal-backdrop{z-index:9999}.attr-modal{z-index:10000}.ekit_multipile_ajax_search_filed .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:1.5;font-size:.9em;border:none;border-radius:0;color:#6d7882}.ekit-headerfooter-status{display:inline-block;margin-left:5px;padding:2px 5px 3px;color:#FFFFFF;background-color:#9a9a9a;border-radius:3px;font-size:10px;line-height:1;font-weight:700}.ekit-headerfooter-status-active{background-color:#00cd00}.irs--round .irs-max,.irs--round .irs-min{display:none}.irs--round .irs-handle{cursor:pointer}.mf-success-msg{position:fixed;z-index:9;text-align:center;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);-webkit-box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);min-width:300px}textarea.attr-form-control{height:auto!important}.post-type-metform-form .row-actions .inline{display:none!important}div.metform-entry-browser-data table tbody,div.metform-entry-browser-data table thead,div.metform-entry-data table tbody,div.metform-entry-data table thead{text-align:left}img.form-editor-icon{height:20px;width:20px;margin-right:5px;vertical-align:middle}div.mf-file-show button.attr-btn.attr-btn-primary{margin-left:10px}.mf-file-show a{text-decoration:none}.mf-modal-container{margin-top:50px}.mf-modal-container .attr-modal-body img{margin:0 auto}.mf-entry-input,.mf-entry-label{-webkit-box-sizing:border-box;box-sizing:border-box}.mf-entry-filter{margin-right:10px}.mf-entry-filter{min-width:15%}.mf-entry-export-csv{min-width:20%}.metform_open_content_editor_modal .attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:before{line-height:20px}
6
-
1
+ .loading .attr-modal-content:before{opacity:.8;position:absolute;content:"";top:0;left:0;height:100%;width:100%;background-color:#fff;-webkit-transition:opaicty .5s ease;-o-transition:opaicty .5s ease;transition:opaicty .5s ease;z-index:5;border-radius:inherit}.loading .ekit-spinner{display:block}.elementor-editor-active .metform-form-save-btn-editor{display:none!important}.attr-modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-top:30px;width:565px}.attr-modal-dialog-centered .attr-modal-header{padding:36px 50px;border-bottom:none}.attr-modal-dialog-centered .attr-modal-header .attr-modal-title{font-size:20px;font-weight:bold;color:#111111;text-transform:capitalize;margin-bottom:38px;line-height:1}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs{border:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs li{margin:0;float:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a{text-decoration:none;text-align:center;color:#111111;font-size:14px;text-transform:capitalize;font-weight:600;padding:8px 14px;border:none;margin-right:0;border:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a:hover{border:none;background-color:transparent}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs a:focus{outline:none;-webkit-box-shadow:none;box-shadow:none;border:none}.attr-modal-dialog-centered .attr-modal-header .attr-nav-tabs li.attr-active a{border:none;color:#ffffff;background-color:#1F55F8;border-radius:4px}.attr-modal-dialog-centered .attr-modal-header button.attr-close{opacity:.8;font-size:inherit;outline:none;margin-top:-15px;margin-right:-25px}.attr-modal-dialog-centered .attr-modal-header button.attr-close span{color:#e81123;font-size:35px;font-weight:100;background-color:#FCE7E9;height:36px;width:36px;display:inline-block;line-height:36px;border-radius:100px;outline:none;margin-top:5px;font-family:initial}.attr-modal-dialog-centered .attr-tab-content .attr-modal-body{padding:40px 50px;padding-top:0}.attr-modal-dialog-centered .attr-tab-content div#limit_status.hide_input{display:none}.attr-modal-dialog-centered .attr-tab-content .mf-input-group label.attr-input-label{color:#111111;font-size:16px;margin-bottom:7px;display:block;font-weight:500}.attr-modal-dialog-centered .attr-tab-content .mf-input-group{margin-bottom:14px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .attr-form-control,.attr-modal-dialog-centered .attr-tab-content .mf-input-group input{color:#555;font-size:14px;height:48px;padding:0 22px;border-color:#ededed;-webkit-box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);margin-top:12px;max-width:100%}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]{display:none}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span{position:relative;display:block}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:before{content:"No";width:55px;height:25px;background-color:#EDEDED;left:0;border-radius:15px;text-align:right;color:#fff;text-transform:uppercase;font-weight:bold;font-size:10px;padding:3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding-right:10px;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s;float:right;line-height:18px;cursor:pointer}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:after{content:"";width:20px;height:20px;background-color:#fff;border-radius:100px;display:inline-block;position:absolute;right:31px;top:2px;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]:checked+span:before{content:"Yes";width:55px;height:25px;background-color:#1F55F8;left:0;border-radius:15px;display:inline-block;text-align:left;color:#fff;text-transform:uppercase;font-weight:bold;font-size:10px;padding:3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:10px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]:checked+span:after{content:"";width:20px;height:20px;background-color:#fff;border-radius:100px;display:inline-block;position:absolute;right:2px;top:2px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-rest-api-method{padding:0 18px;margin:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group span.mf-input-help{color:#b7b7b7;font-style:italic;font-size:12px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group span.mf-input-help strong{color:red}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner label.attr-input-label{display:inline-block}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner #limit_status{width:100px;margin:0;position:relative;margin-left:15px;float:right;margin-top:-2px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input{margin:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]+span:before{position:relative;top:-2px;left:5px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]+span:after{right:28px;top:0px}.attr-modal-dialog-centered .attr-tab-content .mf-input-group .mf-input-group-inner input[type=checkbox]:checked+span:after{right:-2px;top:0}.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=number]+span,.attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=text]+span{display:block;margin-top:5px}.attr-modal-dialog-centered .attr-tab-content #limit_status.show_input{margin-top:32px}.attr-modal-dialog-centered .attr-modal-footer{padding:30px 50px}.attr-modal-dialog-centered .attr-modal-footer button{color:#fff;background-color:#1F55F8;font-size:16px;font-weight:bold;-webkit-box-sizing:border-box;box-sizing:border-box;padding:12px 20px;-webkit-box-shadow:none;box-shadow:none;border:1px solid transparent;-webkit-transition:all .4s;-o-transition:all .4s;transition:all .4s;outline:none}.attr-modal-dialog-centered .attr-modal-footer button:focus{border:none;outline:none}.attr-modal-dialog-centered .attr-modal-footer button.metform-form-save-btn-editor{background-color:#d8d8d8;color:#111111}.attr-modal-dialog-centered>form{width:100%}.modal-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5)}.modal-backdrop{z-index:9999}.attr-modal{z-index:10000}.ekit_multipile_ajax_search_filed .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:1.5;font-size:.9em;border:none;border-radius:0;color:#6d7882}.ekit-headerfooter-status{display:inline-block;margin-left:5px;padding:2px 5px 3px;color:#FFFFFF;background-color:#9a9a9a;border-radius:3px;font-size:10px;line-height:1;font-weight:700}.ekit-headerfooter-status-active{background-color:#00cd00}.irs--round .irs-max,.irs--round .irs-min{display:none}.irs--round .irs-handle{cursor:pointer}.mf-success-msg{position:fixed;z-index:9;text-align:center;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);-webkit-box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);box-shadow:0px 2px 5px rgba(153, 153, 153, 0.2);min-width:300px}textarea.attr-form-control{height:auto!important}.post-type-metform-form .row-actions .inline{display:none!important}div.metform-entry-browser-data table tbody,div.metform-entry-browser-data table thead,div.metform-entry-data table tbody,div.metform-entry-data table thead{text-align:left}img.form-editor-icon{height:20px;width:20px;margin-right:5px;vertical-align:middle}div.mf-file-show button.attr-btn.attr-btn-primary{margin-left:10px}.mf-file-show a{text-decoration:none}.mf-modal-container{margin-top:50px}.mf-modal-container .attr-modal-body img{margin:0 auto}.mf-entry-input,.mf-entry-label{-webkit-box-sizing:border-box;box-sizing:border-box}.mf-entry-filter{margin-right:10px}.mf-entry-filter{min-width:15%}.mf-entry-export-csv{min-width:20%}.metform_open_content_editor_modal .attr-modal-dialog-centered .attr-tab-content .mf-input-group input[type=checkbox]+span:before{line-height:20px}.mf-image-select-input,.mf-toggle-select-input{position:absolute;opacity:0;width:0;height:0}.mf-image-select-input+img,.mf-toggle-select-input+p{cursor:pointer}.mf-input-rest-api-group .mf-rest-api-key{width:100px;display:inline-block;position:relative;top:-1px}.mf-input-rest-api-group .mf-rest-api{width:calc(100% - 110px);vertical-align:middle;display:inline-block!important}.metform_open_content_editor_modal .mf-rest-api-key{top:0}
 
 
 
 
 
libs/assets/js/admin-script.js CHANGED
@@ -152,10 +152,10 @@ jQuery(document).ready(function ($) {
152
 
153
  $('input.mf-form-modalinput-rest_api').on('change',function(){
154
  if($(this).is(":checked")){
155
- $('.mf-rest-api').show();
156
  }
157
  else if($(this).is(":not(:checked)")){
158
- $('.mf-rest-api').hide();
159
  }
160
  });
161
 
@@ -210,7 +210,7 @@ jQuery(document).ready(function ($) {
210
  $('.mf-form-user-confirmation').hide();
211
  $('.mf-form-admin-notification').hide();
212
 
213
- $('.mf-rest-api').hide();
214
  $('.mf-mailchimp').hide();
215
  $('.mf-zapier').hide();
216
  $('.mf-slack').hide();
@@ -366,6 +366,10 @@ jQuery(document).ready(function ($) {
366
  recaptcha.removeAttr('checked');
367
  }
368
 
 
 
 
 
369
  $('.mf-rest-api-url').val(data.mf_rest_api_url);
370
 
371
  $('.mf-mailchimp-api-key').val(data.mf_mailchimp_api_key);
@@ -377,7 +381,7 @@ jQuery(document).ready(function ($) {
377
  $('.mf-recaptcha-site-key').val(data.mf_recaptcha_site_key);
378
  $('.mf-recaptcha-secret-key').val(data.mf_recaptcha_secret_key);
379
 
380
- $('input.mf-form-modalinput-limit_status').trigger('change');
381
  }
382
 
383
  }
152
 
153
  $('input.mf-form-modalinput-rest_api').on('change',function(){
154
  if($(this).is(":checked")){
155
+ $('.mf-input-rest-api-group').show();
156
  }
157
  else if($(this).is(":not(:checked)")){
158
+ $('.mf-input-rest-api-group').hide();
159
  }
160
  });
161
 
210
  $('.mf-form-user-confirmation').hide();
211
  $('.mf-form-admin-notification').hide();
212
 
213
+ $('.mf-input-rest-api-group').hide();
214
  $('.mf-mailchimp').hide();
215
  $('.mf-zapier').hide();
216
  $('.mf-slack').hide();
366
  recaptcha.removeAttr('checked');
367
  }
368
 
369
+
370
+ var api_method = (data.mf_rest_api_method && data.mf_rest_api_method.length) ? data.mf_rest_api_method : 'POST';
371
+ $('.mf-rest-api-method option[value="'+ api_method +'"]').prop('selected', true);
372
+
373
  $('.mf-rest-api-url').val(data.mf_rest_api_url);
374
 
375
  $('.mf-mailchimp-api-key').val(data.mf_mailchimp_api_key);
381
  $('.mf-recaptcha-site-key').val(data.mf_recaptcha_site_key);
382
  $('.mf-recaptcha-secret-key').val(data.mf_recaptcha_secret_key);
383
 
384
+ $('input.mf-form-modalinput-limit_status, .mf-form-modalinput-rest_api').trigger('change');
385
  }
386
 
387
  }
libs/assets/js/inputs.js CHANGED
@@ -95,7 +95,7 @@
95
  },
96
 
97
  SelectInput: function ($scope) {
98
- var el = $scope.find('select.mf-input-dropdown');
99
 
100
  el.select2({
101
  dropdownParent: $scope.find('.mf-input-wrapper')
95
  },
96
 
97
  SelectInput: function ($scope) {
98
+ var el = $scope.find('select.mf-input-select');
99
 
100
  el.select2({
101
  dropdownParent: $scope.find('.mf-input-wrapper')
metform.php CHANGED
@@ -5,7 +5,7 @@ defined( 'ABSPATH' ) || exit;
5
  * Plugin Name: MetForm
6
  * Plugin URI: http://products.wpmet.com/metform/
7
  * Description: Most flexible and design friendly form builder for Elementor
8
- * Version: 1.1.4
9
  * Author: Wpmet
10
  * Author URI: https://wpmet.com
11
  * Text Domain: metform
5
  * Plugin Name: MetForm
6
  * Plugin URI: http://products.wpmet.com/metform/
7
  * Description: Most flexible and design friendly form builder for Elementor
8
+ * Version: 1.1.5
9
  * Author: Wpmet
10
  * Author URI: https://wpmet.com
11
  * Text Domain: metform
plugin.php CHANGED
@@ -12,7 +12,9 @@ final class Plugin{
12
  public function __construct(){
13
  Autoloader::run();
14
  }
15
-
 
 
16
  public function init(){
17
 
18
  // Check if Elementor installed and activated.
@@ -51,10 +53,7 @@ final class Plugin{
51
  Widgets\Manifest::get_instance()->init();
52
  }
53
 
54
- public function version(){
55
- return '1.1.3';
56
- }
57
-
58
  public function package_type(){
59
  return 'free';
60
  }
12
  public function __construct(){
13
  Autoloader::run();
14
  }
15
+ public function version(){
16
+ return '1.1.5';
17
+ }
18
  public function init(){
19
 
20
  // Check if Elementor installed and activated.
53
  Widgets\Manifest::get_instance()->init();
54
  }
55
 
56
+
 
 
 
57
  public function package_type(){
58
  return 'free';
59
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: ataurr, wpmet, emrnco, sayedulsayem
3
  Tags: Form builder, Elementor form builder, contact form, custom form, forms, drag & drop form builder
4
  Requires at least: 4.8
5
  Tested up to: 5.3
6
- Stable tag: 1.1.4
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -40,7 +40,7 @@ Want to give users to upload files from your form? no worry we have file upload
40
  == Export entries as CSV ==
41
  Want to Export entries as CSV? Yes, you can do that too with metform elementor addon.
42
 
43
- = Mailchimp Integration ==
44
  You can use MailChimp in your contact form also create MailChimp signup forms with custom style and expand your lead list.
45
 
46
  == Features ==
@@ -90,7 +90,11 @@ You can use MailChimp in your contact form also create MailChimp signup forms wi
90
  * File Upload
91
 
92
  == Changelog ==
93
- Version 1.1.4
 
 
 
 
94
  Now users can add 3rd party API to get form data
95
  Now date input supports time selection too
96
  Can disable specific date, range date in date picker.
3
  Tags: Form builder, Elementor form builder, contact form, custom form, forms, drag & drop form builder
4
  Requires at least: 4.8
5
  Tested up to: 5.3
6
+ Stable tag: 1.1.5
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
40
  == Export entries as CSV ==
41
  Want to Export entries as CSV? Yes, you can do that too with metform elementor addon.
42
 
43
+ == Mailchimp Integration ==
44
  You can use MailChimp in your contact form also create MailChimp signup forms with custom style and expand your lead list.
45
 
46
  == Features ==
90
  * File Upload
91
 
92
  == Changelog ==
93
+ Version: 1.1.5
94
+ 3rd party plugin compatibility
95
+ Rest API Data submit improvement
96
+
97
+ Version: 1.1.4
98
  Now users can add 3rd party API to get form data
99
  Now date input supports time selection too
100
  Can disable specific date, range date in date picker.
traits/common-controls.php CHANGED
@@ -142,7 +142,6 @@ trait Common_Controls{
142
  'label' => esc_html__( 'Min Length', 'metform' ),
143
  'type' => Controls_Manager::NUMBER,
144
  'step' => 1,
145
- 'default' => 8,
146
  ]
147
  );
148
  $this->add_control(
@@ -151,7 +150,22 @@ trait Common_Controls{
151
  'label' => esc_html__( 'Max Length', 'metform' ),
152
  'type' => Controls_Manager::NUMBER,
153
  'step' => 1,
154
- 'default' => 30,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  ]
156
  );
157
  }
@@ -384,7 +398,7 @@ trait Common_Controls{
384
  'value' => Scheme_Color::COLOR_1,
385
  ],
386
  'selectors' => [
387
- '{{WRAPPER}} .mf-input' => 'color: {{VALUE}}',
388
  '{{WRAPPER}} .irs--round .irs-bar, {{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single' => 'background-color: {{VALUE}}',
389
  '{{WRAPPER}} .irs--round .irs-handle' => 'border-color: {{VALUE}}',
390
  '{{WRAPPER}} .irs--round .irs-from:before, {{WRAPPER}} .irs--round .irs-to:before, {{WRAPPER}} .irs--round .irs-single:before' => 'border-top-color: {{VALUE}}',
@@ -408,7 +422,7 @@ trait Common_Controls{
408
  'name' => 'mf_input_background',
409
  'label' => esc_html__( 'Background', 'metform' ),
410
  'types' => [ 'classic', 'gradient' ],
411
- 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} span.select2-dropdown, {{WRAPPER}} span.select2-dropdown input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice, {{WRAPPER}} .select2-container--default .select2-selection--multiple .select2-selection__choice__remove, {{WRAPPER}} .mf-input-file-upload-label',
412
  ]
413
  );
414
  }
@@ -420,7 +434,7 @@ trait Common_Controls{
420
  [
421
  'name' => 'mf_input_border',
422
  'label' => esc_html__( 'Border', 'metform' ),
423
- 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .select2-container--default .select2-results>.select2-results__options, {{WRAPPER}} .mf-input-file-upload-label',
424
  ]
425
  );
426
  }
@@ -445,7 +459,7 @@ trait Common_Controls{
445
  'value' => Scheme_Color::COLOR_1,
446
  ],
447
  'selectors' => [
448
- '{{WRAPPER}} .mf-input:hover' => 'color: {{VALUE}}',
449
  '{{WRAPPER}} .irs--round .irs-handle:hover' => 'border-color: {{VALUE}}',
450
 
451
  '{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:hover,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove,{{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:hover .mf-image-label' => 'color: {{VALUE}}',
@@ -465,7 +479,7 @@ trait Common_Controls{
465
  'name' => 'mf_input_background_hover',
466
  'label' => esc_html__( 'Background', 'metform' ),
467
  'types' => [ 'classic', 'gradient' ],
468
- 'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label',
469
  ]
470
  );
471
  }
@@ -477,7 +491,7 @@ trait Common_Controls{
477
  [
478
  'name' => 'mf_input_border_hover',
479
  'label' => esc_html__( 'Border', 'metform' ),
480
- 'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:hover, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label',
481
  ]
482
  );
483
  }
@@ -503,7 +517,7 @@ trait Common_Controls{
503
  'value' => Scheme_Color::COLOR_1,
504
  ],
505
  'selectors' => [
506
- '{{WRAPPER}} .mf-input:focus' => 'color: {{VALUE}}',
507
  '{{WRAPPER}} .irs--round .irs-handle:focus' => 'border-color: {{VALUE}}',
508
 
509
  '{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:focus,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:focus .mf-image-label' => 'color: {{VALUE}};',
@@ -524,7 +538,7 @@ trait Common_Controls{
524
  'name' => 'mf_input_background_focus',
525
  'label' => esc_html__( 'Background', 'metform' ),
526
  'types' => [ 'classic', 'gradient' ],
527
- 'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} span.select2-dropdown:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label',
528
  ]
529
  );
530
 
@@ -537,7 +551,7 @@ trait Common_Controls{
537
  [
538
  'name' => 'mf_input_border_focus',
539
  'label' => esc_html__( 'Border', 'metform' ),
540
- 'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:focus, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label',
541
  ]
542
  );
543
  }
@@ -553,7 +567,7 @@ trait Common_Controls{
553
  'name' => 'mf_input_typgraphy',
554
  'label' => esc_html__( 'Typography', 'metform' ),
555
  'scheme' => Scheme_Typography::TYPOGRAPHY_1,
556
- 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-single, {{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true], {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .asRange .asRange-pointer .asRange-tip, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label',
557
  ]
558
  );
559
 
@@ -582,7 +596,7 @@ trait Common_Controls{
582
  ],
583
  'selectors' => [
584
  '{{WRAPPER}} .mf-input' => 'border-radius: {{SIZE}}{{UNIT}};',
585
- '{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label' => 'border-radius: {{SIZE}}{{UNIT}};',
586
  ],
587
  'condition' => [
588
  'mf_input_border_border!' => '',
@@ -595,7 +609,7 @@ trait Common_Controls{
595
  [
596
  'name' => 'mf_input_box_shadow',
597
  'label' => esc_html__( 'Box Shadow', 'metform' ),
598
- 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-line, {{WRAPPER}} .select2-container, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-switch label.mf-input-control-label:before, {{WRAPPER}} .mf-input-wrapper .asRange, {{WRAPPER}} .asRange .asRange-pointer:before, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label',
599
  ]
600
  );
601
 
142
  'label' => esc_html__( 'Min Length', 'metform' ),
143
  'type' => Controls_Manager::NUMBER,
144
  'step' => 1,
 
145
  ]
146
  );
147
  $this->add_control(
150
  'label' => esc_html__( 'Max Length', 'metform' ),
151
  'type' => Controls_Manager::NUMBER,
152
  'step' => 1,
153
+ ]
154
+ );
155
+ }
156
+
157
+ if( in_array('CHAR_WORD', $param) ){
158
+ $this->add_control(
159
+ 'mf_input_validation_type',
160
+ [
161
+ 'label' => esc_html__( 'Validation type', 'metform' ),
162
+ 'type' => Controls_Manager::SELECT,
163
+ 'default' => 'none',
164
+ 'options' => [
165
+ 'none' => esc_html__( 'None', 'metform' ),
166
+ 'character' => esc_html__( 'Character', 'metform' ),
167
+ 'word' => esc_html__( 'Word', 'metform' ),
168
+ ],
169
  ]
170
  );
171
  }
398
  'value' => Scheme_Color::COLOR_1,
399
  ],
400
  'selectors' => [
401
+ '{{WRAPPER}} .mf-input, {{WRAPPER}} {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}',
402
  '{{WRAPPER}} .irs--round .irs-bar, {{WRAPPER}} .irs--round .irs-from, {{WRAPPER}} .irs--round .irs-to, {{WRAPPER}} .irs--round .irs-single' => 'background-color: {{VALUE}}',
403
  '{{WRAPPER}} .irs--round .irs-handle' => 'border-color: {{VALUE}}',
404
  '{{WRAPPER}} .irs--round .irs-from:before, {{WRAPPER}} .irs--round .irs-to:before, {{WRAPPER}} .irs--round .irs-single:before' => 'border-top-color: {{VALUE}}',
422
  'name' => 'mf_input_background',
423
  'label' => esc_html__( 'Background', 'metform' ),
424
  'types' => [ 'classic', 'gradient' ],
425
+ 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} span.select2-dropdown, {{WRAPPER}} span.select2-dropdown input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice, {{WRAPPER}} .select2-container--default .select2-selection--multiple .select2-selection__choice__remove, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
426
  ]
427
  );
428
  }
434
  [
435
  'name' => 'mf_input_border',
436
  'label' => esc_html__( 'Border', 'metform' ),
437
+ 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .select2-container--default .select2-results>.select2-results__options, {{WRAPPER}} .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
438
  ]
439
  );
440
  }
459
  'value' => Scheme_Color::COLOR_1,
460
  ],
461
  'selectors' => [
462
+ '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}',
463
  '{{WRAPPER}} .irs--round .irs-handle:hover' => 'border-color: {{VALUE}}',
464
 
465
  '{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:hover,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove,{{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:hover .mf-image-label' => 'color: {{VALUE}}',
479
  'name' => 'mf_input_background_hover',
480
  'label' => esc_html__( 'Background', 'metform' ),
481
  'types' => [ 'classic', 'gradient' ],
482
+ 'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} span.select2-dropdown:hover, {{WRAPPER}} span.select2-dropdown input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:hover .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag',
483
  ]
484
  );
485
  }
491
  [
492
  'name' => 'mf_input_border_hover',
493
  'label' => esc_html__( 'Border', 'metform' ),
494
+ 'selector' => '{{WRAPPER}} .mf-input:hover, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:hover, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:hover, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:hover, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:hover, {{WRAPPER}} .mf-file-upload-container:hover .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:hover .iti--separate-dial-code .iti__selected-flag',
495
  ]
496
  );
497
  }
517
  'value' => Scheme_Color::COLOR_1,
518
  ],
519
  'selectors' => [
520
+ '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-dial-code' => 'color: {{VALUE}}',
521
  '{{WRAPPER}} .irs--round .irs-handle:focus' => 'border-color: {{VALUE}}',
522
 
523
  '{{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered:focus,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true]:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-file-upload-container:focus .mf-image-label' => 'color: {{VALUE}};',
538
  'name' => 'mf_input_background_focus',
539
  'label' => esc_html__( 'Background', 'metform' ),
540
  'types' => [ 'classic', 'gradient' ],
541
+ 'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} span.select2-dropdown:focus, {{WRAPPER}} span.select2-dropdown input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice:focus .select2-selection__choice__remove, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag',
542
  ]
543
  );
544
 
551
  [
552
  'name' => 'mf_input_border_focus',
553
  'label' => esc_html__( 'Border', 'metform' ),
554
+ 'selector' => '{{WRAPPER}} .mf-input:focus, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single:focus, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field:focus, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option:focus, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered:focus, {{WRAPPER}} .mf-file-upload-container:focus .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper:focus .iti--separate-dial-code .iti__selected-flag',
555
  ]
556
  );
557
  }
567
  'name' => 'mf_input_typgraphy',
568
  'label' => esc_html__( 'Typography', 'metform' ),
569
  'scheme' => Scheme_Typography::TYPOGRAPHY_1,
570
+ 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-single, {{WRAPPER}} .select2-container--default .select2-selection--single .select2-selection__rendered,{{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container--default ul.select2-results__options .select2-results__option[aria-selected=true], {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .asRange .asRange-pointer .asRange-tip, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
571
  ]
572
  );
573
 
596
  ],
597
  'selectors' => [
598
  '{{WRAPPER}} .mf-input' => 'border-radius: {{SIZE}}{{UNIT}};',
599
+ '{{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .select2-container--default .select2-search--dropdown .select2-search__field, {{WRAPPER}} .mf-input-wrapper ul.select2-results__options .select2-results__option, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag' => 'border-radius: {{SIZE}}{{UNIT}};',
600
  ],
601
  'condition' => [
602
  'mf_input_border_border!' => '',
609
  [
610
  'name' => 'mf_input_box_shadow',
611
  'label' => esc_html__( 'Box Shadow', 'metform' ),
612
+ 'selector' => '{{WRAPPER}} .mf-input, {{WRAPPER}} .irs--round .irs-line, {{WRAPPER}} .select2-container, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-dropdown, {{WRAPPER}} .mf-input-wrapper .select2-container .select2-selection--multiple .select2-selection__rendered, {{WRAPPER}} .mf-input-switch label.mf-input-control-label:before, {{WRAPPER}} .mf-input-wrapper .asRange, {{WRAPPER}} .asRange .asRange-pointer:before, {{WRAPPER}} .mf-input-wrapper .select2-container--default .select2-selection--single, {{WRAPPER}} .mf-file-upload-container .mf-input-file-upload-label, {{WRAPPER}} .mf-input-wrapper .iti--separate-dial-code .iti__selected-flag',
613
  ]
614
  );
615
 
widgets/email/email.php CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Email extends widget_base{
49
  ]
50
  );
51
 
52
- $this->input_setting_controls(['MAX_MIN']);
53
 
54
  $this->end_controls_section();
55
 
@@ -118,6 +118,12 @@ Class MetForm_Input_Email extends widget_base{
118
 
119
  $settings = $this->get_settings_for_display();
120
  extract($settings);
 
 
 
 
 
 
121
 
122
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
123
 
@@ -132,8 +138,9 @@ Class MetForm_Input_Email extends widget_base{
132
  }
133
  ?>
134
  <input type="email" class="mf-input" id="mf-input-email-<?php echo esc_attr($this->get_id()); ?>"
135
- name="<?php echo esc_attr($mf_input_name); ?>"
136
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
 
137
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
138
  <?php //echo esc_attr($mf_input_readonly_status); ?>
139
  >
49
  ]
50
  );
51
 
52
+ $this->input_setting_controls(['MAX_MIN', 'CHAR_WORD']);
53
 
54
  $this->end_controls_section();
55
 
118
 
119
  $settings = $this->get_settings_for_display();
120
  extract($settings);
121
+
122
+ $validation = [
123
+ 'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
124
+ 'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
125
+ 'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
126
+ ];
127
 
128
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
129
 
138
  }
139
  ?>
140
  <input type="email" class="mf-input" id="mf-input-email-<?php echo esc_attr($this->get_id()); ?>"
141
+ name="<?php echo esc_attr($mf_input_name); ?>"
142
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
143
+ data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
144
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
145
  <?php //echo esc_attr($mf_input_readonly_status); ?>
146
  >
widgets/listing-fname/listing-fname.php CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Listing_Fname extends Widget_Base{
49
  ]
50
  );
51
 
52
- $this->input_setting_controls(['MAX_MIN']);
53
 
54
  $this->end_controls_section();
55
 
@@ -117,6 +117,12 @@ Class MetForm_Input_Listing_Fname extends Widget_Base{
117
  protected function render($instance = []){
118
  $settings = $this->get_settings_for_display();
119
  extract($settings);
 
 
 
 
 
 
120
 
121
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
122
 
@@ -133,6 +139,7 @@ Class MetForm_Input_Listing_Fname extends Widget_Base{
133
  <input type="text" class="mf-input" id="mf-input-text-<?php echo esc_attr($this->get_id()); ?>"
134
  name="<?php echo esc_attr($mf_input_name); ?>"
135
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
 
136
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
137
  <?php //echo esc_attr($mf_input_readonly_status); ?>
138
  >
49
  ]
50
  );
51
 
52
+ $this->input_setting_controls(['MAX_MIN', 'CHAR_WORD']);
53
 
54
  $this->end_controls_section();
55
 
117
  protected function render($instance = []){
118
  $settings = $this->get_settings_for_display();
119
  extract($settings);
120
+
121
+ $validation = [
122
+ 'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
123
+ 'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
124
+ 'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
125
+ ];
126
 
127
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
128
 
139
  <input type="text" class="mf-input" id="mf-input-text-<?php echo esc_attr($this->get_id()); ?>"
140
  name="<?php echo esc_attr($mf_input_name); ?>"
141
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
142
+ data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
143
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
144
  <?php //echo esc_attr($mf_input_readonly_status); ?>
145
  >
widgets/listing-lname/listing-lname.php CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Listing_Lname extends Widget_Base{
49
  ]
50
  );
51
 
52
- $this->input_setting_controls(['MAX_MIN']);
53
 
54
  $this->end_controls_section();
55
 
@@ -117,6 +117,12 @@ Class MetForm_Input_Listing_Lname extends Widget_Base{
117
  protected function render($instance = []){
118
  $settings = $this->get_settings_for_display();
119
  extract($settings);
 
 
 
 
 
 
120
 
121
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
122
 
@@ -133,6 +139,7 @@ Class MetForm_Input_Listing_Lname extends Widget_Base{
133
  <input type="text" class="mf-input" id="mf-input-text-<?php echo esc_attr($this->get_id()); ?>"
134
  name="<?php echo esc_attr( $mf_input_name ); ?>"
135
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
 
136
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
137
  <?php //echo esc_attr($mf_input_readonly_status); ?>
138
  >
49
  ]
50
  );
51
 
52
+ $this->input_setting_controls(['MAX_MIN', 'CHAR_WORD']);
53
 
54
  $this->end_controls_section();
55
 
117
  protected function render($instance = []){
118
  $settings = $this->get_settings_for_display();
119
  extract($settings);
120
+
121
+ $validation = [
122
+ 'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
123
+ 'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
124
+ 'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
125
+ ];
126
 
127
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
128
 
139
  <input type="text" class="mf-input" id="mf-input-text-<?php echo esc_attr($this->get_id()); ?>"
140
  name="<?php echo esc_attr( $mf_input_name ); ?>"
141
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
142
+ data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
143
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
144
  <?php //echo esc_attr($mf_input_readonly_status); ?>
145
  >
widgets/number/number.php CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Number extends Widget_Base{
49
  ]
50
  );
51
 
52
- $this->input_setting_controls(['MAX_MIN']);
53
 
54
  $this->end_controls_section();
55
 
@@ -116,6 +116,12 @@ Class MetForm_Input_Number extends Widget_Base{
116
  protected function render(){
117
  $settings = $this->get_settings_for_display();
118
  extract($settings);
 
 
 
 
 
 
119
 
120
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
121
 
@@ -132,6 +138,7 @@ Class MetForm_Input_Number extends Widget_Base{
132
  <input type="number" class="mf-input" id="mf-input-mobile-<?php echo esc_attr($this->get_id()); ?>"
133
  name="<?php echo esc_attr($mf_input_name); ?>"
134
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
 
135
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
136
  <?php //echo esc_attr($mf_input_readonly_status); ?>
137
  >
49
  ]
50
  );
51
 
52
+ $this->input_setting_controls(['MAX_MIN', 'CHAR_WORD']);
53
 
54
  $this->end_controls_section();
55
 
116
  protected function render(){
117
  $settings = $this->get_settings_for_display();
118
  extract($settings);
119
+
120
+ $validation = [
121
+ 'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
122
+ 'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
123
+ 'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
124
+ ];
125
 
126
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
127
 
138
  <input type="number" class="mf-input" id="mf-input-mobile-<?php echo esc_attr($this->get_id()); ?>"
139
  name="<?php echo esc_attr($mf_input_name); ?>"
140
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
141
+ data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
142
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
143
  <?php //echo esc_attr($mf_input_readonly_status); ?>
144
  >
widgets/password/password.php CHANGED
@@ -49,7 +49,7 @@ Class MetForm_Input_Password extends Widget_Base{
49
  ]
50
  );
51
 
52
- $this->input_setting_controls(['MAX_MIN']);
53
 
54
  $this->end_controls_section();
55
 
@@ -117,6 +117,12 @@ Class MetForm_Input_Password extends Widget_Base{
117
  protected function render($instance = []){
118
  $settings = $this->get_settings_for_display();
119
  extract($settings);
 
 
 
 
 
 
120
 
121
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
122
 
@@ -133,6 +139,7 @@ Class MetForm_Input_Password extends Widget_Base{
133
  <input type="password" class="mf-input" id="mf-input-password-<?php echo esc_attr($this->get_id()); ?>"
134
  name="<?php echo esc_attr($mf_input_name); ?>"
135
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
 
136
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
137
  <?php //echo esc_attr($mf_input_readonly_status); ?>
138
  >
49
  ]
50
  );
51
 
52
+ $this->input_setting_controls(['MAX_MIN', 'CHAR_WORD']);
53
 
54
  $this->end_controls_section();
55
 
117
  protected function render($instance = []){
118
  $settings = $this->get_settings_for_display();
119
  extract($settings);
120
+
121
+ $validation = [
122
+ 'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
123
+ 'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
124
+ 'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
125
+ ];
126
 
127
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
128
 
139
  <input type="password" class="mf-input" id="mf-input-password-<?php echo esc_attr($this->get_id()); ?>"
140
  name="<?php echo esc_attr($mf_input_name); ?>"
141
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
142
+ data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
143
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
144
  <?php //echo esc_attr($mf_input_readonly_status); ?>
145
  >
widgets/range/range.php CHANGED
@@ -237,8 +237,8 @@ Class MetForm_Input_Range extends Widget_Base{
237
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
238
  <?php //echo esc_attr($mf_input_readonly_status); ?>
239
  value="<?php echo esc_attr($default_value); ?>"
240
- min="<?php echo esc_attr($mf_input_min_length); ?>"
241
- max="<?php echo esc_attr($mf_input_max_length); ?>"
242
  step="<?php echo esc_attr($mf_input_steps_control);?>"
243
  range="<?php echo $mf_input_range_control;?>"
244
  >
237
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
238
  <?php //echo esc_attr($mf_input_readonly_status); ?>
239
  value="<?php echo esc_attr($default_value); ?>"
240
+ min="<?php echo esc_attr(($mf_input_min_length != '') ? $mf_input_min_length : 1); ?>"
241
+ max="<?php echo esc_attr(($mf_input_max_length != '') ? $mf_input_max_length : 100); ?>"
242
  step="<?php echo esc_attr($mf_input_steps_control);?>"
243
  range="<?php echo $mf_input_range_control;?>"
244
  >
widgets/text/text.php CHANGED
@@ -49,7 +49,17 @@ Class MetForm_Input_Text extends Widget_Base{
49
  ]
50
  );
51
 
52
- $this->input_setting_controls(['MAX_MIN']);
 
 
 
 
 
 
 
 
 
 
53
 
54
  $this->end_controls_section();
55
 
@@ -118,6 +128,13 @@ Class MetForm_Input_Text extends Widget_Base{
118
  $settings = $this->get_settings_for_display();
119
  extract($settings);
120
 
 
 
 
 
 
 
 
121
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
122
 
123
  echo "<div class='mf-input-wrapper ".$class."' data-mf-form-conditional-logic-requirement='".(isset($mf_conditional_logic_form_and_or_operators) ? $mf_conditional_logic_form_and_or_operators : '')."'>";
@@ -133,6 +150,7 @@ Class MetForm_Input_Text extends Widget_Base{
133
  <input type="text" class="mf-input" id="mf-input-text-<?php echo esc_attr($this->get_id()); ?>"
134
  name="<?php echo esc_attr($mf_input_name); ?>"
135
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
 
136
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
137
  <?php //echo esc_attr($mf_input_readonly_status); ?>
138
  >
49
  ]
50
  );
51
 
52
+ $this->input_setting_controls(['MAX_MIN', 'CHAR_WORD']);
53
+
54
+ $this->add_control(
55
+ 'mf_input_validation_expression',
56
+ [
57
+ 'label' => esc_html__( 'Expression for validate ', 'metform' ),
58
+ 'type' => Controls_Manager::TEXTAREA,
59
+ 'rows' => 2,
60
+ 'placeholder' => esc_html__( 'Enter here regex', 'metform' ),
61
+ ]
62
+ );
63
 
64
  $this->end_controls_section();
65
 
128
  $settings = $this->get_settings_for_display();
129
  extract($settings);
130
 
131
+ $validation = [
132
+ 'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
133
+ 'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
134
+ 'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
135
+ 'expression' => isset($mf_input_validation_expression) ? $mf_input_validation_expression : '',
136
+ ];
137
+
138
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
139
 
140
  echo "<div class='mf-input-wrapper ".$class."' data-mf-form-conditional-logic-requirement='".(isset($mf_conditional_logic_form_and_or_operators) ? $mf_conditional_logic_form_and_or_operators : '')."'>";
150
  <input type="text" class="mf-input" id="mf-input-text-<?php echo esc_attr($this->get_id()); ?>"
151
  name="<?php echo esc_attr($mf_input_name); ?>"
152
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
153
+ data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
154
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
155
  <?php //echo esc_attr($mf_input_readonly_status); ?>
156
  >
widgets/textarea/textarea.php CHANGED
@@ -50,7 +50,7 @@ Class MetForm_Input_Textarea extends Widget_Base{
50
  ]
51
  );
52
 
53
- $this->input_setting_controls(['MAX_MIN']);
54
 
55
  $this->end_controls_section();
56
 
@@ -140,7 +140,13 @@ Class MetForm_Input_Textarea extends Widget_Base{
140
 
141
  protected function render($instance = []){
142
  $settings = $this->get_settings_for_display();
143
- extract($settings);
 
 
 
 
 
 
144
 
145
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
146
 
@@ -157,6 +163,7 @@ Class MetForm_Input_Textarea extends Widget_Base{
157
  <textarea class="mf-input mf-textarea" id="mf-input-text-area-<?php echo esc_attr($this->get_id()); ?>"
158
  name="<?php echo esc_attr($mf_input_name); ?>"
159
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
 
160
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
161
  <?php //echo esc_attr($mf_input_readonly_status); ?>
162
  cols="30" rows="10"
50
  ]
51
  );
52
 
53
+ $this->input_setting_controls(['MAX_MIN', 'CHAR_WORD']);
54
 
55
  $this->end_controls_section();
56
 
140
 
141
  protected function render($instance = []){
142
  $settings = $this->get_settings_for_display();
143
+ extract($settings);
144
+
145
+ $validation = [
146
+ 'min_length' => isset($mf_input_min_length) ? $mf_input_min_length : '',
147
+ 'max_length' => isset($mf_input_max_length) ? $mf_input_max_length : '',
148
+ 'validation_type' => isset($mf_input_validation_type) ? $mf_input_validation_type : '',
149
+ ];
150
 
151
  $class = (isset($settings['mf_conditional_logic_form_list']) ? 'mf-conditional-input' : '');
152
 
163
  <textarea class="mf-input mf-textarea" id="mf-input-text-area-<?php echo esc_attr($this->get_id()); ?>"
164
  name="<?php echo esc_attr($mf_input_name); ?>"
165
  placeholder="<?php echo esc_html($mf_input_placeholder); ?>"
166
+ data-validation = "<?php echo esc_attr(json_encode($validation)); ?>"
167
  <?php echo esc_attr(($mf_input_required === 'yes') ? 'required' : '')?>
168
  <?php //echo esc_attr($mf_input_readonly_status); ?>
169
  cols="30" rows="10"