Version Description
Added: RegExp for text fields.
Download this release
Release Info
| Developer | webdorado |
| Plugin | |
| Version | 1.0.29 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.28 to 1.0.29
- admin/models/CFMModelManage_cfm.php +11 -1
- contact-form-builder.php +19 -2
- frontend/models/CFMModelForm_maker.php +0 -6
- frontend/views/CFMViewForm_maker.php +25 -4
- js/contactformmaker.js +280 -71
- readme.txt +4 -1
admin/models/CFMModelManage_cfm.php
CHANGED
|
@@ -128,6 +128,9 @@ class CFMModelManage_cfm {
|
|
| 128 |
case 'type_text': {
|
| 129 |
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
|
| 130 |
$temp = $params;
|
|
|
|
|
|
|
|
|
|
| 131 |
foreach ($params_names as $params_name) {
|
| 132 |
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 133 |
$param[$params_name] = $temp[0];
|
|
@@ -143,7 +146,14 @@ class CFMModelManage_cfm {
|
|
| 143 |
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 144 |
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 145 |
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
break;
|
| 148 |
}
|
| 149 |
case 'type_number': {
|
| 128 |
case 'type_text': {
|
| 129 |
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
|
| 130 |
$temp = $params;
|
| 131 |
+
if (strpos($temp, 'w_regExp_status') > -1) {
|
| 132 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
|
| 133 |
+
}
|
| 134 |
foreach ($params_names as $params_name) {
|
| 135 |
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 136 |
$param[$params_name] = $temp[0];
|
| 146 |
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
| 147 |
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 148 |
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
| 149 |
+
|
| 150 |
+
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
| 151 |
+
$param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
|
| 152 |
+
$param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
|
| 153 |
+
$param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
|
| 154 |
+
$param['w_regExp_alert'] = isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : __("Incorrect Value", "contact_form_maker");
|
| 155 |
+
|
| 156 |
+
$rep .= '<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px; vertical-align:top;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_text" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="' . $param['w_regExp_status'] . '" name="' . $id . '_regExpStatusform_id_temp" id="' . $id . '_regExpStatusform_id_temp"><input type="hidden" value="' . $param['w_regExp_value'] . '" name="' . $id . '_regExp_valueform_id_temp" id="' . $id . '_regExp_valueform_id_temp"><input type="hidden" value="' . $param['w_regExp_common'] . '" name="' . $id . '_regExp_commonform_id_temp" id="' . $id . '_regExp_commonform_id_temp"><input type="hidden" value="' . $param['w_regExp_alert'] . '" name="' . $id . '_regExp_alertform_id_temp" id="' . $id . '_regExp_alertform_id_temp"><input type="hidden" value="' . $param['w_regExp_arg'] . '" name="' . $id . '_regArgumentform_id_temp" id="' . $id . '_regArgumentform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
|
| 157 |
break;
|
| 158 |
}
|
| 159 |
case 'type_number': {
|
contact-form-builder.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* Plugin Name: Contact Form Builder
|
| 4 |
* Plugin URI: http://web-dorado.com/products/wordpress-contact-form-builder.html
|
| 5 |
* Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
|
| 6 |
-
* Version: 1.0.
|
| 7 |
* Author: WebDorado
|
| 8 |
* Author URI: http://web-dorado.com/
|
| 9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
|
@@ -170,7 +170,7 @@ if (class_exists('WP_Widget')) {
|
|
| 170 |
// Activate plugin.
|
| 171 |
function contact_form_maker_activate() {
|
| 172 |
$version = get_option("wd_contact_form_maker_version");
|
| 173 |
-
$new_version = '1.0.
|
| 174 |
if ($version && version_compare($version, $new_version, '<')) {
|
| 175 |
require_once WD_CFM_DIR . "/contact-form-builder-update.php";
|
| 176 |
contact_form_maker_update($version);
|
|
@@ -554,6 +554,23 @@ function contact_form_maker_manage_scripts() {
|
|
| 554 |
'fmc_Items_succesfully_saved' => __('Items Succesfully Saved.', 'contact_form_maker'),
|
| 555 |
'fmc_SaveIP' => __('Save IP', 'contact_form_maker'),
|
| 556 |
'fmc_field_required' => __('* field is required.', 'contact_form_maker'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 557 |
));
|
| 558 |
}
|
| 559 |
|
| 3 |
* Plugin Name: Contact Form Builder
|
| 4 |
* Plugin URI: http://web-dorado.com/products/wordpress-contact-form-builder.html
|
| 5 |
* Description: Contact Form Builder is an advanced plugin to add contact forms into your website. It comes along with multiple default templates which can be customized.
|
| 6 |
+
* Version: 1.0.29
|
| 7 |
* Author: WebDorado
|
| 8 |
* Author URI: http://web-dorado.com/
|
| 9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
| 170 |
// Activate plugin.
|
| 171 |
function contact_form_maker_activate() {
|
| 172 |
$version = get_option("wd_contact_form_maker_version");
|
| 173 |
+
$new_version = '1.0.29';
|
| 174 |
if ($version && version_compare($version, $new_version, '<')) {
|
| 175 |
require_once WD_CFM_DIR . "/contact-form-builder-update.php";
|
| 176 |
contact_form_maker_update($version);
|
| 554 |
'fmc_Items_succesfully_saved' => __('Items Succesfully Saved.', 'contact_form_maker'),
|
| 555 |
'fmc_SaveIP' => __('Save IP', 'contact_form_maker'),
|
| 556 |
'fmc_field_required' => __('* field is required.', 'contact_form_maker'),
|
| 557 |
+
'fmc_Validation' => __('Validation (Regular Exp.)', 'contact_form_maker'),
|
| 558 |
+
'fmc_reg_exp' => __('Regular Expression', 'contact_form_maker'),
|
| 559 |
+
'fmc_common_reg_exp' => __('Common Regular Expressions', 'contact_form_maker'),
|
| 560 |
+
'fmc_case_insensitive' => __('Case Insensitive', 'contact_form_maker'),
|
| 561 |
+
'fmc_alert_message' => __('Alert Message', 'contact_form_maker'),
|
| 562 |
+
'fmc_select' => __('Select', 'contact_form_maker'),
|
| 563 |
+
'fmc_name_latin_letters' => __('Name(Latin letters and some symbols)', 'contact_form_maker'),
|
| 564 |
+
'fmc_phone_number' => __('Phone Number(Digits and dashes)', 'contact_form_maker'),
|
| 565 |
+
'fmc_integer_number' => __('Integer Number', 'contact_form_maker'),
|
| 566 |
+
'fmc_decimal_number' => __('Decimal Number', 'contact_form_maker'),
|
| 567 |
+
'fmc_latin_letters_and_numbers' => __('Latin letters and Numbers', 'contact_form_maker'),
|
| 568 |
+
'fmc_credit_card' => __('Credit Card (16 Digits)', 'contact_form_maker'),
|
| 569 |
+
'fmc_zip_code' => __('Zip Code', 'contact_form_maker'),
|
| 570 |
+
'fmc_IP_address' => __('IP Address', 'contact_form_maker'),
|
| 571 |
+
'fmc_date_mdy' => __('Date m/d/y (e.g. 12/21/2013)', 'contact_form_maker'),
|
| 572 |
+
'fmc_date_dmy' => __('Date d.m.y (e.g. 21.12.2013)', 'contact_form_maker'),
|
| 573 |
+
'fmc_date_format' => __('MySQL Date Format (2013-12-21)', 'contact_form_maker'),
|
| 574 |
));
|
| 575 |
}
|
| 576 |
|
frontend/models/CFMModelForm_maker.php
CHANGED
|
@@ -61,9 +61,6 @@ class CFMModelForm_maker {
|
|
| 61 |
}
|
| 62 |
|
| 63 |
public function savedata($form, $id) {
|
| 64 |
-
// if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
|
| 65 |
-
// @session_start();
|
| 66 |
-
// }
|
| 67 |
$all_files = array();
|
| 68 |
$correct = FALSE;
|
| 69 |
$id_for_old = $id;
|
|
@@ -127,9 +124,6 @@ class CFMModelForm_maker {
|
|
| 127 |
|
| 128 |
public function save_db($counter, $id) {
|
| 129 |
global $wpdb;
|
| 130 |
-
// if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
|
| 131 |
-
// @session_start();
|
| 132 |
-
// }
|
| 133 |
$chgnac = TRUE;
|
| 134 |
$all_files = array();
|
| 135 |
$form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "contactformmaker WHERE id= %d", $id));
|
| 61 |
}
|
| 62 |
|
| 63 |
public function savedata($form, $id) {
|
|
|
|
|
|
|
|
|
|
| 64 |
$all_files = array();
|
| 65 |
$correct = FALSE;
|
| 66 |
$id_for_old = $id;
|
| 124 |
|
| 125 |
public function save_db($counter, $id) {
|
| 126 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
| 127 |
$chgnac = TRUE;
|
| 128 |
$all_files = array();
|
| 129 |
$form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "contactformmaker WHERE id= %d", $id));
|
frontend/views/CFMViewForm_maker.php
CHANGED
|
@@ -210,6 +210,9 @@ class CFMViewForm_maker {
|
|
| 210 |
case 'type_text': {
|
| 211 |
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
|
| 212 |
$temp = $params;
|
|
|
|
|
|
|
|
|
|
| 213 |
foreach($params_names as $params_name ) {
|
| 214 |
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 215 |
$param[$params_name] = $temp[0];
|
|
@@ -228,6 +231,7 @@ class CFMViewForm_maker {
|
|
| 228 |
$param['w_field_label_pos2'] = ($param['w_field_label_pos'] == "left" ? "" : "display: block;");
|
| 229 |
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 230 |
$required = ($param['w_required'] == "yes" ? TRUE : FALSE);
|
|
|
|
| 231 |
$rep = '<div type="type_text" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 232 |
if ($required) {
|
| 233 |
$rep .= '<span class="wdform-required">' . $required_sym . '</span>';
|
|
@@ -247,6 +251,23 @@ class CFMViewForm_maker {
|
|
| 247 |
}
|
| 248 |
}';
|
| 249 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
break;
|
| 251 |
}
|
| 252 |
case 'type_number': {
|
|
@@ -745,14 +766,14 @@ class CFMViewForm_maker {
|
|
| 745 |
$check_js .= '
|
| 746 |
if (x.find(jQuery("div[wdid='.$id1.']")).length != 0) {
|
| 747 |
if (jQuery("#wdform_'.$id1.'_element'.$form_id.'").val() != "") {
|
| 748 |
-
|
| 749 |
alert("' . addslashes(__("This is not a valid email address.", 'contact_form_maker')) . '");
|
| 750 |
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 751 |
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 752 |
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 753 |
return false;
|
| 754 |
}
|
| 755 |
-
|
| 756 |
}';
|
| 757 |
break;
|
| 758 |
}
|
|
@@ -1086,7 +1107,7 @@ class CFMViewForm_maker {
|
|
| 1086 |
<script type="text/javascript">
|
| 1087 |
function contactformOnload<?php echo $id; ?>() {
|
| 1088 |
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
|
| 1089 |
-
|
| 1090 |
jQuery("#contactform<?php echo $id; ?>").find(jQuery("input[type='radio']")).click(function() {jQuery("input[type='radio']+label").removeClass('if-ie-div-label'); jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')});
|
| 1091 |
jQuery("#contactform<?php echo $id; ?>").find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
|
| 1092 |
jQuery("#contactform<?php echo $id; ?>").find(jQuery("input[type='checkbox']")).click(function() {jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label'); jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')});
|
|
@@ -1098,7 +1119,7 @@ class CFMViewForm_maker {
|
|
| 1098 |
|
| 1099 |
jQuery('.wdform-element-section').each(function() {
|
| 1100 |
if (!jQuery(this).parent()[0].style.width) {
|
| 1101 |
-
|
| 1102 |
if (jQuery(this).css('display') == "table-cell") {
|
| 1103 |
if (jQuery(this).parent().attr('type') != "type_captcha") {
|
| 1104 |
jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 210 |
case 'type_text': {
|
| 211 |
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
|
| 212 |
$temp = $params;
|
| 213 |
+
if (strpos($temp, 'w_regExp_status') > -1) {
|
| 214 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
|
| 215 |
+
}
|
| 216 |
foreach($params_names as $params_name ) {
|
| 217 |
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
| 218 |
$param[$params_name] = $temp[0];
|
| 231 |
$param['w_field_label_pos2'] = ($param['w_field_label_pos'] == "left" ? "" : "display: block;");
|
| 232 |
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
| 233 |
$required = ($param['w_required'] == "yes" ? TRUE : FALSE);
|
| 234 |
+
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
| 235 |
$rep = '<div type="type_text" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 236 |
if ($required) {
|
| 237 |
$rep .= '<span class="wdform-required">' . $required_sym . '</span>';
|
| 251 |
}
|
| 252 |
}';
|
| 253 |
}
|
| 254 |
+
if ($param['w_regExp_status'] == 'yes') {
|
| 255 |
+
$check_js .= '
|
| 256 |
+
var RegExpression = "";
|
| 257 |
+
var rules = unescape("' . $param["w_regExp_value"] . '");
|
| 258 |
+
("'.$param["w_regExp_arg"].'".length <= 0) ? RegExpression = new RegExp(rules) : RegExpression = new RegExp(rules' . ', "' . $param["w_regExp_arg"] . '");
|
| 259 |
+
if (jQuery("#wdform_' . $id1 . '_element' . $form_id . '").val().length > 0) {
|
| 260 |
+
if (RegExpression.test(jQuery("#wdform_' . $id1 . '_element' . $form_id . '").val()) != true) {
|
| 261 |
+
alert(" '.$param["w_regExp_alert"].' ");
|
| 262 |
+
old_bg = x.find(jQuery("div[wdid=' . $id1 . ']")).css("background-color");
|
| 263 |
+
x.find(jQuery("div[wdid=' . $id1 . ']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 264 |
+
jQuery("#wdform_' . $id1 . '_element' . $form_id . '").addClass("form-error");
|
| 265 |
+
jQuery("#wdform_' . $id1 . '_element' . $form_id . '").focus();
|
| 266 |
+
jQuery("#wdform_' . $id1 . '_element' . $form_id . '").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 267 |
+
return false;
|
| 268 |
+
}
|
| 269 |
+
}';
|
| 270 |
+
}
|
| 271 |
break;
|
| 272 |
}
|
| 273 |
case 'type_number': {
|
| 766 |
$check_js .= '
|
| 767 |
if (x.find(jQuery("div[wdid='.$id1.']")).length != 0) {
|
| 768 |
if (jQuery("#wdform_'.$id1.'_element'.$form_id.'").val() != "") {
|
| 769 |
+
if (jQuery("#wdform_'.$id1.'_element'.$form_id.'").val().search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1) {
|
| 770 |
alert("' . addslashes(__("This is not a valid email address.", 'contact_form_maker')) . '");
|
| 771 |
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 772 |
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 773 |
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 774 |
return false;
|
| 775 |
}
|
| 776 |
+
}
|
| 777 |
}';
|
| 778 |
break;
|
| 779 |
}
|
| 1107 |
<script type="text/javascript">
|
| 1108 |
function contactformOnload<?php echo $id; ?>() {
|
| 1109 |
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
|
| 1110 |
+
if (parseInt(navigator.userAgent.toLowerCase().split('msie')[1]) === 8) {
|
| 1111 |
jQuery("#contactform<?php echo $id; ?>").find(jQuery("input[type='radio']")).click(function() {jQuery("input[type='radio']+label").removeClass('if-ie-div-label'); jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')});
|
| 1112 |
jQuery("#contactform<?php echo $id; ?>").find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
|
| 1113 |
jQuery("#contactform<?php echo $id; ?>").find(jQuery("input[type='checkbox']")).click(function() {jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label'); jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')});
|
| 1119 |
|
| 1120 |
jQuery('.wdform-element-section').each(function() {
|
| 1121 |
if (!jQuery(this).parent()[0].style.width) {
|
| 1122 |
+
if (parseInt(jQuery(this).width()) != 0) {
|
| 1123 |
if (jQuery(this).css('display') == "table-cell") {
|
| 1124 |
if (jQuery(this).parent().attr('type') != "type_captcha") {
|
| 1125 |
jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
js/contactformmaker.js
CHANGED
|
@@ -191,83 +191,63 @@ function add_attr(i, type) {
|
|
| 191 |
refresh_attr(i, type);
|
| 192 |
}
|
| 193 |
|
| 194 |
-
function change_attribute_value(id, x, type)
|
| 195 |
-
{
|
| 196 |
-
if(!document.getElementById("attr_name"+x).value)
|
| 197 |
-
{
|
| 198 |
alert(fmc_objectL10n.fmc_name_attribute_required);
|
| 199 |
return
|
| 200 |
}
|
| 201 |
-
|
| 202 |
-
if(document.getElementById("attr_name"+x).value.toLowerCase()=="style")
|
| 203 |
-
{
|
| 204 |
alert(fmc_objectL10n.fmc_cannot_add_style_attribute);
|
| 205 |
return
|
| 206 |
}
|
| 207 |
-
|
| 208 |
refresh_attr(id, type);
|
| 209 |
}
|
| 210 |
|
| 211 |
-
function change_attribute_name(id, x, type)
|
| 212 |
-
|
| 213 |
-
value
|
| 214 |
-
if(!value)
|
| 215 |
-
{
|
| 216 |
alert(fmc_objectL10n.fmc_name_attribute_required);
|
| 217 |
return;
|
| 218 |
}
|
| 219 |
-
|
| 220 |
-
if(value.toLowerCase()=="style")
|
| 221 |
-
{
|
| 222 |
alert(fmc_objectL10n.fmc_cannot_add_style_attribute);
|
| 223 |
return;
|
| 224 |
}
|
| 225 |
-
|
| 226 |
-
if(value==parseInt(value))
|
| 227 |
-
{
|
| 228 |
alert(fmc_objectL10n.fmc_name_attribute_cannotbe_number);
|
| 229 |
return;
|
| 230 |
}
|
| 231 |
-
|
| 232 |
-
if(value.indexOf(" ")!=-1)
|
| 233 |
-
{
|
| 234 |
var regExp = /\s+/g;
|
| 235 |
-
value=value.replace(regExp,'');
|
| 236 |
-
x.value=value;
|
| 237 |
alert(fmc_objectL10n.fmc_name_attribute_cannot_containspace);
|
| 238 |
refresh_attr(id, type);
|
| 239 |
return;
|
| 240 |
-
}
|
| 241 |
-
|
| 242 |
refresh_attr(id, type);
|
| 243 |
-
|
| 244 |
}
|
| 245 |
|
| 246 |
-
function remove_attr(id, el_id,type)
|
| 247 |
-
{
|
| 248 |
tr=document.getElementById("attr_row_"+id);
|
| 249 |
tr.parentNode.removeChild(tr);
|
| 250 |
refresh_attr(el_id, type);
|
| 251 |
}
|
| 252 |
|
| 253 |
-
function change_attributes(id, attr)
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
var div = document.createElement('div');
|
| 257 |
-
var element=document.getElementById(id);
|
| 258 |
element.setAttribute(attr, '');
|
| 259 |
}
|
| 260 |
|
| 261 |
-
function change_class(x,id)
|
| 262 |
-
{
|
| 263 |
if(document.getElementById(id+'_label_sectionform_id_temp'))
|
| 264 |
document.getElementById(id+'_label_sectionform_id_temp').setAttribute("class",x);
|
| 265 |
if(document.getElementById(id+'_element_sectionform_id_temp'))
|
| 266 |
document.getElementById(id+'_element_sectionform_id_temp').setAttribute("class",x);
|
| 267 |
}
|
| 268 |
|
| 269 |
-
function set_required(id)
|
| 270 |
-
{
|
| 271 |
if(document.getElementById(id+"form_id_temp").value=="yes")
|
| 272 |
{
|
| 273 |
document.getElementById(id+"form_id_temp").setAttribute("value", "no");
|
|
@@ -2636,7 +2616,7 @@ refresh_attr(i, 'type_text');
|
|
| 2636 |
}
|
| 2637 |
|
| 2638 |
|
| 2639 |
-
function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_attr_name, w_attr_value) {
|
| 2640 |
|
| 2641 |
document.getElementById("element_type").value="type_text";
|
| 2642 |
|
|
@@ -2662,7 +2642,21 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 2662 |
var edit_main_tr9 = document.createElement('tr');
|
| 2663 |
var edit_main_tr10 = document.createElement('tr');
|
| 2664 |
var edit_main_tr11 = document.createElement('tr');
|
| 2665 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2666 |
var edit_main_td1 = document.createElement('td');
|
| 2667 |
var edit_main_td1_1 = document.createElement('td');
|
| 2668 |
|
|
@@ -2691,6 +2685,18 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 2691 |
|
| 2692 |
var edit_main_td11 = document.createElement('td');
|
| 2693 |
var edit_main_td11_1 = document.createElement('td');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2694 |
|
| 2695 |
var el_label_disable = document.createElement('label');
|
| 2696 |
el_label_disable.setAttribute("for", "edit_for_disable");
|
|
@@ -2782,7 +2788,98 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 2782 |
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
| 2783 |
if(w_required=="yes")
|
| 2784 |
el_required.setAttribute("checked", "checked");
|
| 2785 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2786 |
|
| 2787 |
var el_unique_label = document.createElement('label');
|
| 2788 |
el_unique_label.setAttribute("for", "el_unique");
|
|
@@ -2908,6 +3005,20 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 2908 |
edit_main_td10.appendChild(el_label_size_label);
|
| 2909 |
edit_main_td10_1.appendChild(el_label_size);
|
| 2910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2911 |
edit_main_td2.appendChild(el_label_position_label);
|
| 2912 |
edit_main_td2.appendChild(br);
|
| 2913 |
edit_main_td2_1.appendChild(el_label_position1);
|
|
@@ -2946,6 +3057,20 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 2946 |
edit_main_tr1.appendChild(edit_main_td1_1);
|
| 2947 |
edit_main_tr10.appendChild(edit_main_td10);
|
| 2948 |
edit_main_tr10.appendChild(edit_main_td10_1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2949 |
edit_main_tr2.appendChild(edit_main_td2);
|
| 2950 |
edit_main_tr2.appendChild(edit_main_td2_1);
|
| 2951 |
edit_main_tr3.appendChild(edit_main_td3);
|
|
@@ -2970,6 +3095,11 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 2970 |
edit_main_table.appendChild(edit_main_tr5);
|
| 2971 |
edit_main_table.appendChild(edit_main_tr9);
|
| 2972 |
edit_main_table.appendChild(edit_main_tr6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2973 |
edit_main_table.appendChild(edit_main_tr8);
|
| 2974 |
edit_main_table.appendChild(edit_main_tr7);
|
| 2975 |
edit_div.appendChild(edit_main_table);
|
|
@@ -3018,44 +3148,70 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 3018 |
adding.setAttribute("onBlur", 'return_value("'+i+'_elementform_id_temp")');
|
| 3019 |
adding.setAttribute("onChange", 'change_value("'+i+'_elementform_id_temp")');
|
| 3020 |
|
| 3021 |
-
|
| 3022 |
-
|
| 3023 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3024 |
|
| 3025 |
-
|
| 3026 |
-
|
| 3027 |
|
| 3028 |
-
|
| 3029 |
-
|
| 3030 |
-
|
| 3031 |
div_label.style.width= w_field_label_size+'px';
|
| 3032 |
-
|
| 3033 |
-
|
| 3034 |
-
var div_element = document.createElement('div');
|
| 3035 |
-
div_element.setAttribute("align", 'left');
|
| 3036 |
-
div_element.style.display="table-cell";
|
| 3037 |
-
div_element.setAttribute("id", i+"_element_sectionform_id_temp");
|
| 3038 |
-
|
| 3039 |
-
var br1 = document.createElement('br');
|
| 3040 |
-
var br2 = document.createElement('br');
|
| 3041 |
-
var br3 = document.createElement('br');
|
| 3042 |
-
var br4 = document.createElement('br');
|
| 3043 |
-
|
| 3044 |
|
| 3045 |
-
|
| 3046 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3047 |
label.setAttribute("id", i+"_element_labelform_id_temp");
|
| 3048 |
label.innerHTML = w_field_label;
|
| 3049 |
label.setAttribute("class", "label");
|
| 3050 |
label.style.verticalAlign="top";
|
| 3051 |
|
| 3052 |
-
|
| 3053 |
-
var required = document.createElement('span');
|
| 3054 |
required.setAttribute("id", i+"_required_elementform_id_temp");
|
| 3055 |
required.innerHTML = "";
|
| 3056 |
required.setAttribute("class", "required");
|
| 3057 |
required.style.verticalAlign="top";
|
| 3058 |
-
|
| 3059 |
required.innerHTML = " *";
|
| 3060 |
var main_td = document.getElementById('show_table');
|
| 3061 |
|
|
@@ -3063,6 +3219,11 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 3063 |
div_label.appendChild(required);
|
| 3064 |
div_element.appendChild(adding_type);
|
| 3065 |
div_element.appendChild(adding_required);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3066 |
div_element.appendChild(adding_unique);
|
| 3067 |
div_element.appendChild(adding);
|
| 3068 |
div_field.appendChild(div_label);
|
|
@@ -3076,12 +3237,45 @@ function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_si
|
|
| 3076 |
refresh_attr(i, 'type_text');
|
| 3077 |
}
|
| 3078 |
|
| 3079 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3080 |
|
| 3081 |
-
|
| 3082 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3083 |
delete_last_child();
|
| 3084 |
-
/* edit table */
|
| 3085 |
var edit_div = document.createElement('div');
|
| 3086 |
edit_div.setAttribute("id", "edit_div");
|
| 3087 |
edit_div.setAttribute("style", "padding-left:25px; padding-right:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
|
@@ -10350,10 +10544,15 @@ function edit(id) {
|
|
| 10350 |
{
|
| 10351 |
w_first_val=document.getElementById(id+"_elementform_id_temp").value;
|
| 10352 |
w_title=document.getElementById(id+"_elementform_id_temp").title;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10353 |
atrs=return_attributes(id+'_elementform_id_temp');
|
| 10354 |
w_attr_name=atrs[0];
|
| 10355 |
w_attr_value=atrs[1];
|
| 10356 |
-
type_text(id, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_attr_name, w_attr_value); break;
|
| 10357 |
}
|
| 10358 |
case 'type_number':
|
| 10359 |
{
|
|
@@ -10717,6 +10916,11 @@ function gen_form_fields()
|
|
| 10717 |
{
|
| 10718 |
w_first_val=document.getElementById(id+"_elementform_id_temp").value;
|
| 10719 |
w_title=document.getElementById(id+"_elementform_id_temp").title;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10720 |
atrs=return_attributes(id+'_elementform_id_temp');
|
| 10721 |
w_attr_name=atrs[0];
|
| 10722 |
w_attr_value=atrs[1];
|
|
@@ -10728,6 +10932,11 @@ function gen_form_fields()
|
|
| 10728 |
form_fields+=w_first_val+"*:*w_first_val*:*";
|
| 10729 |
form_fields+=w_title+"*:*w_title*:*";
|
| 10730 |
form_fields+=w_required+"*:*w_required*:*";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10731 |
form_fields+=w_unique+"*:*w_unique*:*";
|
| 10732 |
|
| 10733 |
for(j=0; j<w_attr_name.length; j++)
|
| 191 |
refresh_attr(i, type);
|
| 192 |
}
|
| 193 |
|
| 194 |
+
function change_attribute_value(id, x, type) {
|
| 195 |
+
if (!document.getElementById("attr_name" + x).value) {
|
|
|
|
|
|
|
| 196 |
alert(fmc_objectL10n.fmc_name_attribute_required);
|
| 197 |
return
|
| 198 |
}
|
| 199 |
+
if (document.getElementById("attr_name" + x).value.toLowerCase() == "style") {
|
|
|
|
|
|
|
| 200 |
alert(fmc_objectL10n.fmc_cannot_add_style_attribute);
|
| 201 |
return
|
| 202 |
}
|
|
|
|
| 203 |
refresh_attr(id, type);
|
| 204 |
}
|
| 205 |
|
| 206 |
+
function change_attribute_name(id, x, type) {
|
| 207 |
+
value = x.value;
|
| 208 |
+
if (!value) {
|
|
|
|
|
|
|
| 209 |
alert(fmc_objectL10n.fmc_name_attribute_required);
|
| 210 |
return;
|
| 211 |
}
|
| 212 |
+
if (value.toLowerCase() == "style") {
|
|
|
|
|
|
|
| 213 |
alert(fmc_objectL10n.fmc_cannot_add_style_attribute);
|
| 214 |
return;
|
| 215 |
}
|
| 216 |
+
if (value == parseInt(value)) {
|
|
|
|
|
|
|
| 217 |
alert(fmc_objectL10n.fmc_name_attribute_cannotbe_number);
|
| 218 |
return;
|
| 219 |
}
|
| 220 |
+
if (value.indexOf(" ") != -1) {
|
|
|
|
|
|
|
| 221 |
var regExp = /\s+/g;
|
| 222 |
+
value=value.replace(regExp,'');
|
| 223 |
+
x.value = value;
|
| 224 |
alert(fmc_objectL10n.fmc_name_attribute_cannot_containspace);
|
| 225 |
refresh_attr(id, type);
|
| 226 |
return;
|
| 227 |
+
}
|
|
|
|
| 228 |
refresh_attr(id, type);
|
|
|
|
| 229 |
}
|
| 230 |
|
| 231 |
+
function remove_attr(id, el_id, type) {
|
|
|
|
| 232 |
tr=document.getElementById("attr_row_"+id);
|
| 233 |
tr.parentNode.removeChild(tr);
|
| 234 |
refresh_attr(el_id, type);
|
| 235 |
}
|
| 236 |
|
| 237 |
+
function change_attributes(id, attr) {
|
| 238 |
+
var div = document.createElement('div');
|
| 239 |
+
var element = document.getElementById(id);
|
|
|
|
|
|
|
| 240 |
element.setAttribute(attr, '');
|
| 241 |
}
|
| 242 |
|
| 243 |
+
function change_class(x,id) {
|
|
|
|
| 244 |
if(document.getElementById(id+'_label_sectionform_id_temp'))
|
| 245 |
document.getElementById(id+'_label_sectionform_id_temp').setAttribute("class",x);
|
| 246 |
if(document.getElementById(id+'_element_sectionform_id_temp'))
|
| 247 |
document.getElementById(id+'_element_sectionform_id_temp').setAttribute("class",x);
|
| 248 |
}
|
| 249 |
|
| 250 |
+
function set_required(id) {
|
|
|
|
| 251 |
if(document.getElementById(id+"form_id_temp").value=="yes")
|
| 252 |
{
|
| 253 |
document.getElementById(id+"form_id_temp").setAttribute("value", "no");
|
| 2616 |
}
|
| 2617 |
|
| 2618 |
|
| 2619 |
+
function type_text(i, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_regExp_status, w_regExp_value, w_regExp_common, w_regExp_arg, w_regExp_alert, w_unique, w_attr_name, w_attr_value) {
|
| 2620 |
|
| 2621 |
document.getElementById("element_type").value="type_text";
|
| 2622 |
|
| 2642 |
var edit_main_tr9 = document.createElement('tr');
|
| 2643 |
var edit_main_tr10 = document.createElement('tr');
|
| 2644 |
var edit_main_tr11 = document.createElement('tr');
|
| 2645 |
+
var edit_main_tr12 = document.createElement('tr');
|
| 2646 |
+
var edit_main_tr13 = document.createElement('tr');
|
| 2647 |
+
edit_main_tr13.setAttribute("id", "edit_main_tr13");
|
| 2648 |
+
var edit_main_tr14 = document.createElement('tr');
|
| 2649 |
+
edit_main_tr14.setAttribute("id", "edit_main_tr14");
|
| 2650 |
+
var edit_main_tr15 = document.createElement('tr');
|
| 2651 |
+
edit_main_tr15.setAttribute("id", "edit_main_tr15");
|
| 2652 |
+
var edit_main_tr16 = document.createElement('tr');
|
| 2653 |
+
edit_main_tr16.setAttribute("id", "edit_main_tr16");
|
| 2654 |
+
if (w_regExp_status == 'no' || w_regExp_status == "") {
|
| 2655 |
+
edit_main_tr13.style.cssText = 'display: none;';
|
| 2656 |
+
edit_main_tr14.style.cssText = 'display: none;';
|
| 2657 |
+
edit_main_tr15.style.cssText = 'display: none;';
|
| 2658 |
+
edit_main_tr16.style.cssText = 'display: none;';
|
| 2659 |
+
}
|
| 2660 |
var edit_main_td1 = document.createElement('td');
|
| 2661 |
var edit_main_td1_1 = document.createElement('td');
|
| 2662 |
|
| 2685 |
|
| 2686 |
var edit_main_td11 = document.createElement('td');
|
| 2687 |
var edit_main_td11_1 = document.createElement('td');
|
| 2688 |
+
|
| 2689 |
+
var edit_main_td12 = document.createElement('td');
|
| 2690 |
+
var edit_main_td12_1 = document.createElement('td');
|
| 2691 |
+
var edit_main_td13 = document.createElement('td');
|
| 2692 |
+
var edit_main_td13_1 = document.createElement('td');
|
| 2693 |
+
var edit_main_td14 = document.createElement('td');
|
| 2694 |
+
var edit_main_td14_1 = document.createElement('td');
|
| 2695 |
+
var edit_main_td15 = document.createElement('td');
|
| 2696 |
+
var edit_main_td15_1 = document.createElement('td');
|
| 2697 |
+
var edit_main_td16 = document.createElement('td');
|
| 2698 |
+
var edit_main_td16_1 = document.createElement('td');
|
| 2699 |
+
|
| 2700 |
|
| 2701 |
var el_label_disable = document.createElement('label');
|
| 2702 |
el_label_disable.setAttribute("for", "edit_for_disable");
|
| 2788 |
el_required.setAttribute("onclick", "set_required('"+i+"_required')");
|
| 2789 |
if(w_required=="yes")
|
| 2790 |
el_required.setAttribute("checked", "checked");
|
| 2791 |
+
|
| 2792 |
+
/********************** REGULAR EXPRESSION ************************/
|
| 2793 |
+
var el_add_regExp_label = document.createElement('label');
|
| 2794 |
+
el_add_regExp_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 13px";
|
| 2795 |
+
el_add_regExp_label.setAttribute("for", "el_regExp_"+i);
|
| 2796 |
+
el_add_regExp_label.innerHTML = fmc_objectL10n.fmc_Validation;
|
| 2797 |
+
|
| 2798 |
+
var el_add_regExp = document.createElement('input');
|
| 2799 |
+
el_add_regExp.setAttribute("id", "el_regExp_"+i);
|
| 2800 |
+
el_add_regExp.setAttribute("type", "checkbox");
|
| 2801 |
+
el_add_regExp.setAttribute("onclick", "set_regExpStatus('"+i+"_regExpStatus')");
|
| 2802 |
+
if(w_regExp_status == "yes")
|
| 2803 |
+
el_add_regExp.setAttribute("checked", "checked");
|
| 2804 |
+
|
| 2805 |
+
var el_reg_value_label = document.createElement('label');
|
| 2806 |
+
el_reg_value_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
| 2807 |
+
el_reg_value_label.setAttribute("class","regExp_cell");
|
| 2808 |
+
el_reg_value_label.innerHTML = fmc_objectL10n.fmc_reg_exp;
|
| 2809 |
+
|
| 2810 |
+
var el_reg_value = document.createElement('textarea');
|
| 2811 |
+
el_reg_value.style.cssText = "width:205px";
|
| 2812 |
+
el_reg_value.setAttribute("id", "regExp_value"+i);
|
| 2813 |
+
el_reg_value.setAttribute("class","regExp_cell");
|
| 2814 |
+
el_reg_value.setAttribute("onKeyUp", "change_regExpValue('"+i+"', this.value ,'"+i+"_regExp_valueform_id_temp','')");
|
| 2815 |
+
el_reg_value.innerHTML = w_regExp_value;
|
| 2816 |
+
|
| 2817 |
+
var count = 0;
|
| 2818 |
+
var common_val_arr = [];
|
| 2819 |
+
common_val_arr[fmc_objectL10n.fmc_select] = "";
|
| 2820 |
+
common_val_arr[fmc_objectL10n.fmc_name_latin_letters] = "^[a-zA-Z'-'\\s]+$";
|
| 2821 |
+
common_val_arr[fmc_objectL10n.fmc_phone_number] = "^(\\+)?[0-9]+(-[0-9]+)?(-[0-9]+)?(-[0-9]+)?$";
|
| 2822 |
+
common_val_arr[fmc_objectL10n.fmc_integer_number] = "^(-)?[0-9]+$";
|
| 2823 |
+
common_val_arr[fmc_objectL10n.fmc_decimal_number] = "^(-)?[0-9]+(\\.[0-9]+)?$";
|
| 2824 |
+
common_val_arr[fmc_objectL10n.fmc_latin_letters_and_numbers] = "^[a-z&A-Z0-9]*$";
|
| 2825 |
+
common_val_arr[fmc_objectL10n.fmc_credit_card] = "^([0-9](\\.)?){15}[0-9]$";
|
| 2826 |
+
common_val_arr[fmc_objectL10n.fmc_zip_code] = "^(\\d{5}-\\d{4}|\\d{5}|\\d{9})$|^([a-zA-Z]\\d[a-zA-Z] \\d[a-zA-Z]\\d)$";
|
| 2827 |
+
common_val_arr[fmc_objectL10n.fmc_IP_address] = "^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$";
|
| 2828 |
+
common_val_arr[fmc_objectL10n.fmc_date_mdy] = "^([0-9]|1[0,1,2])/([0-9]|[0,1,2][0-9]|3[0,1])/[0-9]{4}$";
|
| 2829 |
+
common_val_arr[fmc_objectL10n.fmc_date_dmy] = "^([0-9]|[0,1,2][0-9]|3[0,1])\\.([0-9]|1[0,1,2])\\.[0-9]{4}$";
|
| 2830 |
+
common_val_arr[fmc_objectL10n.fmc_date_format] = "^\\d{4}-(0[0-9]|1[0,1,2])-([0,1,2][0-9]|3[0,1])$";
|
| 2831 |
+
|
| 2832 |
+
var el_reg_com_val_label = document.createElement('label');
|
| 2833 |
+
el_reg_com_val_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
| 2834 |
+
el_reg_com_val_label.setAttribute("class","regExp_cell");
|
| 2835 |
+
el_reg_com_val_label.innerHTML = fmc_objectL10n.fmc_common_reg_exp;
|
| 2836 |
+
|
| 2837 |
+
var el_reg_com_val = document.createElement('select');
|
| 2838 |
+
el_reg_com_val.setAttribute("id", "common_RegExp"+i);
|
| 2839 |
+
el_reg_com_val.setAttribute("name", "common_RegExp"+i);
|
| 2840 |
+
el_reg_com_val.setAttribute("onChange", "change_regExpValue('"+i+"','"+w_regExp_value+"','"+i+"_regExp_valueform_id_temp', this.value)");
|
| 2841 |
+
|
| 2842 |
+
for (var keys in common_val_arr) {
|
| 2843 |
+
if (!common_val_arr.hasOwnProperty(keys)) {
|
| 2844 |
+
continue;
|
| 2845 |
+
}
|
| 2846 |
+
var el_option_common = "el_com_val"+count;
|
| 2847 |
+
el_option_common = document.createElement('option');
|
| 2848 |
+
el_option_common.setAttribute("id", "edit_for_label_common"+count);
|
| 2849 |
+
el_option_common.setAttribute("value",common_val_arr[keys]);
|
| 2850 |
+
if (w_regExp_common == count)
|
| 2851 |
+
el_option_common.setAttribute("selected", "selected");
|
| 2852 |
+
el_option_common.innerHTML = keys;
|
| 2853 |
+
|
| 2854 |
+
el_reg_com_val.appendChild(el_option_common);
|
| 2855 |
+
count++;
|
| 2856 |
+
}
|
| 2857 |
+
|
| 2858 |
+
var el_reg_arg_label = document.createElement('label');
|
| 2859 |
+
el_reg_arg_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
| 2860 |
+
el_reg_arg_label.setAttribute("class","regExp_cell");
|
| 2861 |
+
el_reg_arg_label.innerHTML = fmc_objectL10n.fmc_case_insensitive;
|
| 2862 |
+
|
| 2863 |
+
var el_reg_arg = document.createElement('input');
|
| 2864 |
+
el_reg_arg.setAttribute("id", "el_regArg_"+i+" ");
|
| 2865 |
+
el_reg_arg.setAttribute("type", "checkbox");
|
| 2866 |
+
el_reg_arg.setAttribute("onclick", "set_regExpArgument('"+i+"_regArgument')");
|
| 2867 |
+
if(w_regExp_arg == 'i')
|
| 2868 |
+
el_reg_arg.setAttribute("checked", "checked");
|
| 2869 |
+
|
| 2870 |
+
var el_reg_alert_label = document.createElement('label');
|
| 2871 |
+
el_reg_alert_label.style.cssText ="color:#00aeef; font-weight:bold; font-size: 11px";
|
| 2872 |
+
el_reg_alert_label.innerHTML = fmc_objectL10n.fmc_alert_message;
|
| 2873 |
+
el_reg_alert_label.setAttribute("class","regExp_cell");
|
| 2874 |
+
|
| 2875 |
+
var el_reg_alert = document.createElement('textarea');
|
| 2876 |
+
el_reg_alert.setAttribute("type", "text");
|
| 2877 |
+
el_reg_alert.style.cssText = "width:205px";
|
| 2878 |
+
el_reg_alert.setAttribute("id", "regExp_alert"+i);
|
| 2879 |
+
el_reg_alert.setAttribute("class","regExp_cell");
|
| 2880 |
+
el_reg_alert.setAttribute("onKeyUp", "change_regExpAlert(this.value,'"+i+"_regExp_alertform_id_temp')");
|
| 2881 |
+
el_reg_alert.innerHTML = w_regExp_alert;
|
| 2882 |
+
/**************************************************************************/
|
| 2883 |
|
| 2884 |
var el_unique_label = document.createElement('label');
|
| 2885 |
el_unique_label.setAttribute("for", "el_unique");
|
| 3005 |
edit_main_td10.appendChild(el_label_size_label);
|
| 3006 |
edit_main_td10_1.appendChild(el_label_size);
|
| 3007 |
|
| 3008 |
+
edit_main_td12.appendChild(el_add_regExp_label);
|
| 3009 |
+
edit_main_td12_1.appendChild(el_add_regExp);
|
| 3010 |
+
|
| 3011 |
+
edit_main_td13.appendChild(el_reg_value_label);
|
| 3012 |
+
edit_main_td13_1.appendChild(el_reg_value);
|
| 3013 |
+
|
| 3014 |
+
edit_main_td14.appendChild(el_reg_com_val_label);
|
| 3015 |
+
edit_main_td14_1.appendChild(el_reg_com_val);
|
| 3016 |
+
|
| 3017 |
+
edit_main_td15.appendChild(el_reg_arg_label);
|
| 3018 |
+
edit_main_td15_1.appendChild(el_reg_arg);
|
| 3019 |
+
|
| 3020 |
+
edit_main_td16.appendChild(el_reg_alert_label);
|
| 3021 |
+
edit_main_td16_1.appendChild(el_reg_alert);
|
| 3022 |
edit_main_td2.appendChild(el_label_position_label);
|
| 3023 |
edit_main_td2.appendChild(br);
|
| 3024 |
edit_main_td2_1.appendChild(el_label_position1);
|
| 3057 |
edit_main_tr1.appendChild(edit_main_td1_1);
|
| 3058 |
edit_main_tr10.appendChild(edit_main_td10);
|
| 3059 |
edit_main_tr10.appendChild(edit_main_td10_1);
|
| 3060 |
+
edit_main_tr12.appendChild(edit_main_td12);
|
| 3061 |
+
edit_main_tr12.appendChild(edit_main_td12_1);
|
| 3062 |
+
|
| 3063 |
+
edit_main_tr13.appendChild(edit_main_td13);
|
| 3064 |
+
edit_main_tr13.appendChild(edit_main_td13_1);
|
| 3065 |
+
|
| 3066 |
+
edit_main_tr14.appendChild(edit_main_td14);
|
| 3067 |
+
edit_main_tr14.appendChild(edit_main_td14_1);
|
| 3068 |
+
|
| 3069 |
+
edit_main_tr15.appendChild(edit_main_td15);
|
| 3070 |
+
edit_main_tr15.appendChild(edit_main_td15_1);
|
| 3071 |
+
|
| 3072 |
+
edit_main_tr16.appendChild(edit_main_td16);
|
| 3073 |
+
edit_main_tr16.appendChild(edit_main_td16_1);
|
| 3074 |
edit_main_tr2.appendChild(edit_main_td2);
|
| 3075 |
edit_main_tr2.appendChild(edit_main_td2_1);
|
| 3076 |
edit_main_tr3.appendChild(edit_main_td3);
|
| 3095 |
edit_main_table.appendChild(edit_main_tr5);
|
| 3096 |
edit_main_table.appendChild(edit_main_tr9);
|
| 3097 |
edit_main_table.appendChild(edit_main_tr6);
|
| 3098 |
+
edit_main_table.appendChild(edit_main_tr12);
|
| 3099 |
+
edit_main_table.appendChild(edit_main_tr13);
|
| 3100 |
+
edit_main_table.appendChild(edit_main_tr14);
|
| 3101 |
+
edit_main_table.appendChild(edit_main_tr15);
|
| 3102 |
+
edit_main_table.appendChild(edit_main_tr16);
|
| 3103 |
edit_main_table.appendChild(edit_main_tr8);
|
| 3104 |
edit_main_table.appendChild(edit_main_tr7);
|
| 3105 |
edit_div.appendChild(edit_main_table);
|
| 3148 |
adding.setAttribute("onBlur", 'return_value("'+i+'_elementform_id_temp")');
|
| 3149 |
adding.setAttribute("onChange", 'change_value("'+i+'_elementform_id_temp")');
|
| 3150 |
|
| 3151 |
+
var adding_regExp_status = document.createElement("input");
|
| 3152 |
+
adding_regExp_status.setAttribute("type", "hidden");
|
| 3153 |
+
adding_regExp_status.setAttribute("value", w_regExp_status);
|
| 3154 |
+
adding_regExp_status.setAttribute("name", i+"_regExpStatusform_id_temp");
|
| 3155 |
+
adding_regExp_status.setAttribute("id", i+"_regExpStatusform_id_temp");
|
| 3156 |
+
|
| 3157 |
+
var adding_regArg = document.createElement("input");
|
| 3158 |
+
adding_regArg.setAttribute("type", "hidden");
|
| 3159 |
+
adding_regArg.setAttribute("value", w_regExp_arg);
|
| 3160 |
+
adding_regArg.setAttribute("name", i+"_regArgumentform_id_temp");
|
| 3161 |
+
adding_regArg.setAttribute("id", i+"_regArgumentform_id_temp");
|
| 3162 |
+
|
| 3163 |
+
var adding_regExp_common = document.createElement("input");
|
| 3164 |
+
adding_regExp_common.setAttribute("type", "hidden");
|
| 3165 |
+
adding_regExp_common.setAttribute("value", w_regExp_common);
|
| 3166 |
+
adding_regExp_common.setAttribute("name", i+"_regExp_commonform_id_temp");
|
| 3167 |
+
adding_regExp_common.setAttribute("id", i+"_regExp_commonform_id_temp");
|
| 3168 |
+
|
| 3169 |
+
var adding_regExp_value = document.createElement("input");
|
| 3170 |
+
adding_regExp_value.setAttribute("type", "hidden");
|
| 3171 |
+
adding_regExp_value.setAttribute("value", escape(w_regExp_value));
|
| 3172 |
+
adding_regExp_value.setAttribute("name", i+"_regExp_valueform_id_temp");
|
| 3173 |
+
adding_regExp_value.setAttribute("id", i+"_regExp_valueform_id_temp");
|
| 3174 |
+
|
| 3175 |
+
var adding_regExp_alert = document.createElement("input");
|
| 3176 |
+
adding_regExp_alert.setAttribute("type", "hidden");
|
| 3177 |
+
adding_regExp_alert.setAttribute("value", w_regExp_alert);
|
| 3178 |
+
adding_regExp_alert.setAttribute("name", i+"_regExp_alertform_id_temp");
|
| 3179 |
+
adding_regExp_alert.setAttribute("id", i+"_regExp_alertform_id_temp");
|
| 3180 |
+
|
| 3181 |
+
var div = document.createElement('div');
|
| 3182 |
+
div.setAttribute("id", "main_div");
|
| 3183 |
|
| 3184 |
+
var div_field = document.createElement('div');
|
| 3185 |
+
div_field.setAttribute("id", i+"_elemet_tableform_id_temp");
|
| 3186 |
|
| 3187 |
+
var div_label = document.createElement('div');
|
| 3188 |
+
div_label.setAttribute("align", 'left');
|
| 3189 |
+
div_label.style.display="table-cell";
|
| 3190 |
div_label.style.width= w_field_label_size+'px';
|
| 3191 |
+
div_label.setAttribute("id", i+"_label_sectionform_id_temp");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3192 |
|
| 3193 |
+
var div_element = document.createElement('div');
|
| 3194 |
+
div_element.setAttribute("align", 'left');
|
| 3195 |
+
div_element.style.display="table-cell";
|
| 3196 |
+
div_element.setAttribute("id", i+"_element_sectionform_id_temp");
|
| 3197 |
+
|
| 3198 |
+
var br1 = document.createElement('br');
|
| 3199 |
+
var br2 = document.createElement('br');
|
| 3200 |
+
var br3 = document.createElement('br');
|
| 3201 |
+
var br4 = document.createElement('br');
|
| 3202 |
+
|
| 3203 |
+
var label = document.createElement('span');
|
| 3204 |
label.setAttribute("id", i+"_element_labelform_id_temp");
|
| 3205 |
label.innerHTML = w_field_label;
|
| 3206 |
label.setAttribute("class", "label");
|
| 3207 |
label.style.verticalAlign="top";
|
| 3208 |
|
| 3209 |
+
var required = document.createElement('span');
|
|
|
|
| 3210 |
required.setAttribute("id", i+"_required_elementform_id_temp");
|
| 3211 |
required.innerHTML = "";
|
| 3212 |
required.setAttribute("class", "required");
|
| 3213 |
required.style.verticalAlign="top";
|
| 3214 |
+
if(w_required=="yes")
|
| 3215 |
required.innerHTML = " *";
|
| 3216 |
var main_td = document.getElementById('show_table');
|
| 3217 |
|
| 3219 |
div_label.appendChild(required);
|
| 3220 |
div_element.appendChild(adding_type);
|
| 3221 |
div_element.appendChild(adding_required);
|
| 3222 |
+
div_element.appendChild(adding_regExp_status);
|
| 3223 |
+
div_element.appendChild(adding_regExp_value);
|
| 3224 |
+
div_element.appendChild(adding_regExp_common);
|
| 3225 |
+
div_element.appendChild(adding_regExp_alert);
|
| 3226 |
+
div_element.appendChild(adding_regArg);
|
| 3227 |
div_element.appendChild(adding_unique);
|
| 3228 |
div_element.appendChild(adding);
|
| 3229 |
div_field.appendChild(div_label);
|
| 3237 |
refresh_attr(i, 'type_text');
|
| 3238 |
}
|
| 3239 |
|
| 3240 |
+
function set_regExpStatus(id) {
|
| 3241 |
+
jQuery('#edit_main_tr13, #edit_main_tr14, #edit_main_tr15, #edit_main_tr16').toggle(200);
|
| 3242 |
+
if (document.getElementById(id+"form_id_temp").value == "yes") {
|
| 3243 |
+
document.getElementById(id+"form_id_temp").setAttribute("value", "no");
|
| 3244 |
+
}
|
| 3245 |
+
else {
|
| 3246 |
+
document.getElementById(id + "form_id_temp").setAttribute("value", "yes");
|
| 3247 |
+
}
|
| 3248 |
+
}
|
| 3249 |
|
| 3250 |
+
function set_regExpArgument(id) {
|
| 3251 |
+
if (document.getElementById(id + "form_id_temp").value.length <= 0) {
|
| 3252 |
+
document.getElementById(id + "form_id_temp").setAttribute("value", "i");
|
| 3253 |
+
}
|
| 3254 |
+
else {
|
| 3255 |
+
document.getElementById(id+"form_id_temp").setAttribute("value", "");
|
| 3256 |
+
}
|
| 3257 |
+
}
|
| 3258 |
+
|
| 3259 |
+
function change_regExpValue(i, regValue, regVal_id, com_option) {
|
| 3260 |
+
if (com_option.length > 0) {
|
| 3261 |
+
document.getElementById("regExp_value" + i).value = com_option;
|
| 3262 |
+
document.getElementById(regVal_id).value = com_option;
|
| 3263 |
+
document.getElementById(i + "_regExp_commonform_id_temp").value = document.getElementById("common_RegExp" + i).selectedIndex;
|
| 3264 |
+
}
|
| 3265 |
+
else {
|
| 3266 |
+
document.getElementById(regVal_id).value = regValue;
|
| 3267 |
+
document.getElementById(i + "_regExp_commonform_id_temp").value = regValue;
|
| 3268 |
+
}
|
| 3269 |
+
}
|
| 3270 |
+
|
| 3271 |
+
function change_regExpAlert(regAlert, id) {
|
| 3272 |
+
document.getElementById(id).value = regAlert;
|
| 3273 |
+
}
|
| 3274 |
+
|
| 3275 |
+
function type_number(i, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required, w_unique, w_class, w_attr_name, w_attr_value) {
|
| 3276 |
+
document.getElementById("element_type").value = "type_number";
|
| 3277 |
delete_last_child();
|
| 3278 |
+
/* edit table */
|
| 3279 |
var edit_div = document.createElement('div');
|
| 3280 |
edit_div.setAttribute("id", "edit_div");
|
| 3281 |
edit_div.setAttribute("style", "padding-left:25px; padding-right:10px; padding-top:0px; padding-bottom:0px; margin-top:10px;");
|
| 10544 |
{
|
| 10545 |
w_first_val=document.getElementById(id+"_elementform_id_temp").value;
|
| 10546 |
w_title=document.getElementById(id+"_elementform_id_temp").title;
|
| 10547 |
+
w_regExp_status = document.getElementById(id+"_regExpStatusform_id_temp").value;
|
| 10548 |
+
w_regExp_value = unescape(document.getElementById(id+"_regExp_valueform_id_temp").value);
|
| 10549 |
+
w_regExp_common = document.getElementById(id+"_regExp_commonform_id_temp").value;
|
| 10550 |
+
w_regExp_arg = document.getElementById(id+"_regArgumentform_id_temp").value;
|
| 10551 |
+
w_regExp_alert = document.getElementById(id+"_regExp_alertform_id_temp").value;
|
| 10552 |
atrs=return_attributes(id+'_elementform_id_temp');
|
| 10553 |
w_attr_name=atrs[0];
|
| 10554 |
w_attr_value=atrs[1];
|
| 10555 |
+
type_text(id, w_field_label, w_field_label_size, w_field_label_pos, w_size, w_first_val, w_title, w_required,w_regExp_status, w_regExp_value, w_regExp_common, w_regExp_arg, w_regExp_alert, w_unique, w_attr_name, w_attr_value); break;
|
| 10556 |
}
|
| 10557 |
case 'type_number':
|
| 10558 |
{
|
| 10916 |
{
|
| 10917 |
w_first_val=document.getElementById(id+"_elementform_id_temp").value;
|
| 10918 |
w_title=document.getElementById(id+"_elementform_id_temp").title;
|
| 10919 |
+
w_regExp_status = document.getElementById(id+"_regExpStatusform_id_temp").value;
|
| 10920 |
+
w_regExp_value = document.getElementById(id+"_regExp_valueform_id_temp").value;
|
| 10921 |
+
w_regExp_common = document.getElementById(id+"_regExp_commonform_id_temp").value;
|
| 10922 |
+
w_regExp_arg = document.getElementById(id+"_regArgumentform_id_temp").value;
|
| 10923 |
+
w_regExp_alert = document.getElementById(id+"_regExp_alertform_id_temp").value;
|
| 10924 |
atrs=return_attributes(id+'_elementform_id_temp');
|
| 10925 |
w_attr_name=atrs[0];
|
| 10926 |
w_attr_value=atrs[1];
|
| 10932 |
form_fields+=w_first_val+"*:*w_first_val*:*";
|
| 10933 |
form_fields+=w_title+"*:*w_title*:*";
|
| 10934 |
form_fields+=w_required+"*:*w_required*:*";
|
| 10935 |
+
form_fields+=w_regExp_status+"*:*w_regExp_status*:*";
|
| 10936 |
+
form_fields+=w_regExp_value+"*:*w_regExp_value*:*";
|
| 10937 |
+
form_fields+=w_regExp_common+"*:*w_regExp_common*:*";
|
| 10938 |
+
form_fields+=w_regExp_arg+"*:*w_regExp_arg*:*";
|
| 10939 |
+
form_fields+=w_regExp_alert+"*:*w_regExp_alert*:*";
|
| 10940 |
form_fields+=w_unique+"*:*w_unique*:*";
|
| 10941 |
|
| 10942 |
for(j=0; j<w_attr_name.length; j++)
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-contact-form-builder.html
|
|
| 4 |
Tags: form, forms, contact form, contact forms, contact form plugin, contact forms plugin, forms plugin, Contact Form Builder, contact form manager, multiple contact forms, custom form, Contact Form Builder with recaptcha, contact form with google map, feedback form, feedback forms, contact us, wordpress contact form, email form, feedback, web form, contact me, email, contact manager, contact us form, admin, captcha, contact, database, email, javascript, jquery, page, plugin, survey, widget, custom form, forms creator, text input, validation, send copy, form with captcha, advanced form, recaptcha, contact form with captcha
|
| 5 |
Requires at least: 3.4
|
| 6 |
Tested up to: 4.3
|
| 7 |
-
Stable tag: 1.0.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -138,6 +138,9 @@ After downloading the ZIP file,
|
|
| 138 |
|
| 139 |
== Changelog ==
|
| 140 |
|
|
|
|
|
|
|
|
|
|
| 141 |
= 1.0.28 =
|
| 142 |
Changed: Compability with Wordpress 4.3.
|
| 143 |
|
| 4 |
Tags: form, forms, contact form, contact forms, contact form plugin, contact forms plugin, forms plugin, Contact Form Builder, contact form manager, multiple contact forms, custom form, Contact Form Builder with recaptcha, contact form with google map, feedback form, feedback forms, contact us, wordpress contact form, email form, feedback, web form, contact me, email, contact manager, contact us form, admin, captcha, contact, database, email, javascript, jquery, page, plugin, survey, widget, custom form, forms creator, text input, validation, send copy, form with captcha, advanced form, recaptcha, contact form with captcha
|
| 5 |
Requires at least: 3.4
|
| 6 |
Tested up to: 4.3
|
| 7 |
+
Stable tag: 1.0.29
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 138 |
|
| 139 |
== Changelog ==
|
| 140 |
|
| 141 |
+
= 1.0.29 =
|
| 142 |
+
Added: RegExp for text fields.
|
| 143 |
+
|
| 144 |
= 1.0.28 =
|
| 145 |
Changed: Compability with Wordpress 4.3.
|
| 146 |
|
