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
<script> | |
/* disables copy and paste */ | |
document.getElementById("field_conf_29yf4d2").addEventListener('paste', e => e.preventDefault()); | |
/* disables drag and drop */ | |
document.getElementById("field_conf_29yf4d2").addEventListener('drop', e => e.preventDefault()); | |
/* disables browser autocomplete */ | |
document.getElementById("field_conf_29yf4d2").addEventListener('autocomplete', e => e.preventDefault()); |
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
<script> | |
jQuery(document).ready(function($) { | |
"use strict"; | |
/* Format link phone number */ | |
$("#field_devdir_country_code, #field_devdir_primary_contact_phone").on("change", function() { | |
var link_number = $("#field_devdir_country_code").val() + $("#field_devdir_primary_contact_phone").val(); | |
$("#field_devdir_link_phone_number").val( link_number.replace(/\D/g,'') ); | |
}); | |
}); | |
</script> |
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
/* functions to create a persistent form */ | |
function browser_supports_storage() { | |
return ( typeof(Storage) !== "undefined" ) ? true : false; | |
} | |
function local_data_exists() { | |
return ( localStorage.getItem('data') ) ? true : false; | |
} | |
function cookie_is_used_for_persistence() { |
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
<script> | |
jQuery(document).ready(function($) { | |
"use strict"; | |
// populate primary contact name and email from registration credentials | |
$("#field_devdir_copy_name_and_email").on("change", function() { | |
if ( $(this).prop('checked') ) { | |
bindCurrent(); | |
} else { | |
unbindCurrent(); |
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
<?php | |
/* use the frm_display_entry_content filter hook to conditionally display the relationship form for | |
* adding a new relationship record or relationship view for editing the relationship in place in the | |
* media contacts view | |
*/ | |
add_filter('frm_display_entry_content', 'media_contact_relationships', 20, 7); | |
function media_contact_relationships($new_content, $entry, $shortcodes, $display, $show, $odd, $atts) { | |
if ( $display->ID == 14318 ) { | |
$results = masterminds_check_relationships( $entry->id ); |
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
<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 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
<?php | |
$("#field_phone_number").on('change', function() { | |
$("#field_stripped_phone_number").val( $(this).val().replace(/[^\d+]/g, '') ); | |
}); |
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
<?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 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
<?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' => ' ', |