Skip to content

Instantly share code, notes, and snippets.

View aimahdi's full-sized avatar
💭
Working on something bigger

Amimul Ihsan aimahdi

💭
Working on something bigger
View GitHub Profile
@aimahdi
aimahdi / rangeslider.js
Created October 5, 2021 10:21
range slider: put comma and a dollar sign before the number
let rangeSlider = document.querySelector("#ff_258_rangeslider");
let rangeValue = document.querySelector(".ff_range_value");
rangeSlider.onchange = function(event){
let commaValue = event.target.value.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
rangeValue.innerText = "$ "+commaValue;
}
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
var daysText = "days";
let fp = flatpickr("#ff_225_from", {}); //change form id with yours
let fp2 = flatpickr("#ff_225_to", {}); //change form id with yours
@aimahdi
aimahdi / fluent_form_lost_password.php
Last active April 9, 2025 10:09
Add a lost password action in Fluent Forms
add_action('fluentform/before_insert_submission', function ($insertData, $data, $form) {
if($form->id != 17) { // 17 is your form id. Change the 17 with your own login for ID
return;
}
$redirectUrl = home_url(); // You can change the redirect url after successful login
if (get_current_user_id()) { // user already registered
wp_send_json_success([
'result' => [
add_filter('fluentform_validate_input_item_phone', function($errorMessage, $field, $formData, $fields, $form) {
$target_form_id = 302;
if($form->id != $target_form_id ) {
return $errorMessage ;
}
var_dump($fromData->form_fields);
if( $formData['phone'] != $formData['phone_1'] ){
add_action('fluentform_before_insert_submission', function ($insertData, $data, $form) {
if($form->id != 180) { // 180 is your form id. Change the 23 with your own login for ID
return;
}
$redirectUrl = home_url().'/library/shelves/'; // You can change the redirect url after successful login
if (get_current_user_id()) { // user already registered
wp_send_json_success([
'result' => [
function add_login_check()
{
if (is_user_logged_in()) {
if (is_page(200)){
wp_redirect('https://dev-mahdii.pantheonsite.io/');
exit;
}
}
}
function add_login_check()
{
if (is_user_logged_in()) {
if (is_page(200)){
wp_redirect('https://dev-mahdii.pantheonsite.io/');
exit;
}
}
}
add_action('fluentform_before_submission_confirmation', 'your_custom_confirmation_function', 20, 3);
function your_custom_confirmation_function($entryId, $formData, $form)
{
if ($form->id != 207) {
return;
}
sleep(20);
// DO your stuff here
}
add_filter('fluentform_rendering_field_data_select', function ($data, $form) {
$targetFormID = 2;
//google sheet shared as CSV link
$csvUrl = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vSQM0ay3KgEmTp64M7ZZ5n5QXHDsSzaaJcVCuIHBvgMIw32foNpdfd4jNnUMua8b5Mavb6E4jox_nic/pub?output=csv';
$columName = 'Opex Vessel Categories'; // 'Players' is the column name
$uniqueData = false; // remove duplicate values
if ($form->id != $targetFormID) {
add_filter('fluentform_entry_statuses_core', function ($statuses) {
$statuses['important'] = 'Important';
return $statuses;
}, 10, 1);