This file contains 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
<script> | |
jQuery(document).ready(function ($) { | |
"use strict"; | |
/* conditions to trigger show or hide checkboxes: | |
* 1. if current value is checked in this row, do nothing | |
* 2. if current value is checked in previous row, hide value in this row | |
* 3. if current value is checked in future row, hide value in this row | |
* 4. if current value is unchecked in this row, is it hidden because it was checked in another row? If so, is it now unchecked in the other row, then show it. | |
* 5. if user removes row, all checked boxes in that row need to be shown again in all remaining rows. |
This file contains 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
<?php | |
$("#field_phone_number").on('change', function() { | |
$("#field_stripped_phone_number").val( $(this).val().replace(/[^\d+]/g, '') ); | |
}); |
This file contains 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
<?php | |
add_action('frm_after_update_entry', 'update_user_role', 10, 2); | |
function update_user_role($entry_id, $form_id){ | |
if ( $form_id == 4 ) { | |
$userid = $_POST['item_meta'][15];// ID of the userID field | |
$role = $_POST['item_meta'][19];// ID of the role field | |
if ( $userid && $role ) { |
This file contains 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
<?php | |
apply_filters( 'frm_currencies', 'add_currency' ); | |
function add_currency( $currencies ) { | |
/* this adds the Eastern Caribbean dollar to Formidable's currency list */ | |
$currencies['XCD']= array( | |
'name' => __( 'Eastern Caribbean dollar', 'formidable-pro' ), | |
'symbol_left' => '$', | |
'symbol_right' => '', | |
'symbol_padding' => ' ', |
This file contains 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
<?php | |
add_action( 'frmreg_after_create_user', 'do_custom_action_after_registration', 10, 2 ); | |
function do_custom_action_after_registration( $user_id, $args ) { | |
if ( $args['entry']->form_id == 32 ) {// Replace 32 with your form ID | |
$entry_id = $args['entry']->id; | |
$field_id = 805; | |
$current_value = FrmEntryMeta::get_entry_meta_by_field( $entry_id, $field_id ); | |
if( is_null($current_value) ) { | |
$added = FrmEntryMeta::add_entry_meta( $entry_id, $field_id, null, $user_id ); |
This file contains 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
<?php | |
add_action('frm_after_update_entry', 'populate_additional_workflow', 10, 2); | |
function populate_additional_workflow( $entry_id, $form_id ) { | |
/* get the project form id */ | |
$project_form = FrmForm::get_id_by_key('project_with_workflow'); | |
if( $form_id == $project_form ) { | |
/* initialize variables */ | |
global $wpdb, $user_ID; |
This file contains 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
<?php | |
add_action('frm_after_create_entry', 'generate_form_e2pdf_for_summary', 30, 2); | |
add_action('frm_after_update_entry', 'generate_form_e2pdf_for_summary', 10, 2); | |
function generate_form_e2pdf_for_summary($entry_id, $form_id) { | |
global $wpdb; | |
$formIdList = array(1,2,3); // use your own list of form ids for which you use e2pdf |
This file contains 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
<?php | |
/* this will write the QR Code URL to the form entry */ | |
add_action( 'frmapi_post_response', 'frm_save_api_response', 10, 3 ); | |
function frm_save_api_response( $response, $entry, $form_action ) { | |
/* convert the response to a PHP object */ | |
$results = json_decode($response['body']); | |
/* get the results code */ | |
$code = $response['response']['code']; |