This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var from = "from"; //change the name attribute of the from date field | |
var to = "to"; //change the name attribute of the to date field | |
var showHere = "showHere"; //change the name attribute of show difference field | |
let fp = flatpickr("#ff_91_from", {}); // Your Form's ID | |
let fp2 = flatpickr("#ff_91_to", {}); // Your Form's ID | |
function getDayDiff(input_name_1, input_name_2) { | |
var $date1 = $form.find('input[name='+input_name_1+']'); | |
var time2 = (new Date()).getTime(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluentform_validate_input_item_input_date', function ($errorMessage, $field, $formData, $fields, $form) { | |
$fieldName = 'weddingdate'; | |
$target_form_id = 104; | |
if ($target_form_id != $form->id) { | |
return $errorMessage; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'admin_menu', function () { | |
add_menu_page( 'Admin View', 'NT Admin', 'manage_options', 'myplugin/myplugin-admin-page.php', function () { | |
$tableId = 173; // This is ninja table ID; | |
ninjaRenderTableOnAdmin($tableId); | |
}, 'dashicons-tickets', 6 ); | |
} ); | |
// Global function to render a table in admin panel | |
function ninjaRenderTableOnAdmin($tableId) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const textarea = document.getElementById('TextArea_ID'); // Replace the id | |
textarea.addEventListener('input', function() { | |
const minTextLength = 10; // Set Minimum required text length | |
if (textarea.value.length < minTextLength) { | |
textarea.setCustomValidity('Please enter at least ' + minTextLength + ' characters.'); | |
} else { | |
textarea.setCustomValidity(''); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$form.on('fluentform_submission_success', function() { | |
setTimeout(function(){ window.location.assign("http://www.mozilla.org");}, 5000); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluentform/rendering_field_data_select', 'populateUserRoleAsDropdownValue', 10, 2); | |
add_filter('fluentform/editor_init_element_select', 'populateUserRoleAsDropdownValue', 10, 2); | |
function populateUserRoleAsDropdownValue($data, $form) | |
{ | |
if ($form->id != '678') { | |
return $data; | |
} | |
// Check if the field name is not what you want |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluent_support/customer_ticket_priorities', function ($priorities) { | |
// Change 'Normal' to 'priority_1' | |
$priorities['normal'] = __('priority_1', 'fluent-support'); | |
// Change 'Medium' to 'priority_2' | |
$priorities['medium'] = __('priority_2', 'fluent-support'); | |
// Change 'Critical' to 'priority_3' | |
$priorities['critical'] = __('priority_3', 'fluent-support'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluent_support/ticket_status_groups', function ($statusGroups) { | |
// Modify the array keys | |
$statusGroups['khula'] = $statusGroups['open']; | |
$statusGroups['choler'] = $statusGroups['active']; | |
$statusGroups['bondo'] = $statusGroups['closed']; | |
$statusGroups['notun'] = $statusGroups['new']; | |
$statusGroups['hokol_ticket'] = $statusGroups['all']; | |
// Remove the old keys if necessary | |
unset($statusGroups['open']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('fluent_support/custom_registration_form_fields', function($fields) { | |
$fields['phone_number'] = [ | |
'required' => false, | |
'type' => 'number', | |
'label' => __('Phone Number', 'fluent-support'), | |
'id' => 'fst_phone_number', | |
'placeholder' => __('phone_number', 'fluent-support'), | |
'wrapper_class' => 'fs_half_field', | |
]; |
OlderNewer