Skip to content

Instantly share code, notes, and snippets.

View tahmid-ul's full-sized avatar
🎯
Focusing

Tahmid ul karim tahmid-ul

🎯
Focusing
  • AuthLab
  • Sylhet, Bangladesh
View GitHub Profile
// Add the JS code to your Forms custom JS section.
// Add a container class with the name - max_1_items on your checkbox field.
function maxItemsCheck(containerClass, maxChecked) {
const checkboxes = document.querySelectorAll('.' + containerClass + ' input');
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
const checkedCheckboxes = document.querySelectorAll('.' + containerClass + ' input:checked');
const count = checkedCheckboxes.length;
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_action('fluentform_before_insert_submission', function ($insertData, $data, $form) {
if($form->id != 98) { // 23 is your form id. Change the 23 with your own login for ID
return;
}
$selected_login = \FluentForm\Framework\Helpers\ArrayHelper::get($data, 'input_radio');
if($selected_login == 'Login') {
$redirectUrl = home_url(); // You can change the redirect url after successful login
@media (max-width: 1024px) {
table.ff_flexible_table tbody tr {
display: block;
background: #fff;
position: relative;
border-bottom: 1px solid #ced4da;
border-top: 1px solid #ced4da;
border-color: #ced4da;
border-style: solid;
border-width: 2px 1px 4px;
/*
Add class 'dropzone' to the upload fields that you would like to have this styling
*/
.fluentform .dropzone .ff_upload_btn.ff-btn {
color: #646c7f;
padding: 3rem;
width: 100%;
border: 2px dashed #0087f7;
border-radius: 5px;
background: rgba(223, 240, 255, 0.13);
@tahmid-ul
tahmid-ul / Number_format_individual_shortcode.php
Last active June 2, 2021 08:18
Fix number format (EU, US) for individual shortcode when used in pdf or email.
<?php
add_filter('fluentform_response_render_input_number', function ($response, $field, $form_id, $isHtml = true) {
if (!$response ) {
return $response;
}
$fieldSettings = \FluentForm\Framework\Helpers\ArrayHelper::get($field, 'raw.settings');
$formatter = \FluentForm\Framework\Helpers\ArrayHelper::get($fieldSettings, 'numeric_formatter');
<?php
/*
* If you select plain design on email feed for email. Fluent Forms does not add any additional html templating for email body.
* But your email body still may have HTML from the email body composer and smart codes. You can use this snippet to convert the body in pure-text format
*/
add_filter('fluentform_email_body', function($body, $notification) {
if(isset($notification['asPlainText']) && $notification['asPlainText'] == 'yes') {
return strip_tags($body, '<b><strong>');
@tahmid-ul
tahmid-ul / ff_Unique_5_digit_ID.php
Last active November 10, 2022 03:29
Smart shortcode to generate unique 5 digit number
/*
* Add the smartcode to the list
*/
add_filter('fluentform_editor_shortcodes', function ($smartCodes) {
$smartCodes[0]['shortcodes']['{5_digit_unique_id}'] = 'Unique ID (5 digit)';
return $smartCodes;
});
/*
* Transform the smartcode
@tahmid-ul
tahmid-ul / ff_repeater_sum.js
Created April 21, 2021 19:48
Calculates the sum of the numbers entered in each row of repeater field in Fluent forms
(function($) {
let minus;
$('body').on('click','.js-repeat-buttons',function(){
calculate();
})
function calculate(){
let length = $('table.ff_repeater_table > tbody > tr').length
let plocha = 0;
@tahmid-ul
tahmid-ul / fluent_form_image_choice_style.css
Last active June 11, 2021 06:31
Clickable image for Radio or Checkbox field
/**
* Styles the Radio field as clickable image for Fluent Forms
*
* Use: Paste into Custom CSS Section of your Form
* Add class "fancy-input" to container of all inputs that need the fancy styling
*
* Forked version of Sebastian Berger from inital post Fluent Forms FB Group - https://bit.ly/37BBpet
* FB Post - https://bit.ly/2ZEn2BG
*
* Full Links at bottom