Skip to content

Instantly share code, notes, and snippets.

Avatar

Victor M. Font Jr. vfontjr

View GitHub Profile
View update_field_values.php
<?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 );
View populate_additional_workflow.php
<?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;
View robl-source-code.php
<?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
View disable-form-submit-button.html
<div class="frm_submit" style="display:none;">
[if back_button]<button type="submit" name="frm_prev_page" formnovalidate="formnovalidate" class="frm_prev_page" [back_hook]>[back_label]</button>[/if back_button]
<button class="frm_button_submit" type="submit" [button_action] disabled>[button_label]</button>
[if save_draft]<a href="#" tabindex="0" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]
</div>
View frm_save_api_response.php
<?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'];
View change-start-day.js
<script>
jQuery(document).ready(function($) {
"use strict";
/* change the calendar start day when date field receives foucus */
$('#field_zkbet').on('focus', function() {
/* get the radio button value */
var selected_day = $('input[name="item_meta[286]"]:checked').val();
View form-checkbox.html
<div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
<div id="field_[key]_label" class="frm_primary_label">[field_name]
<span class="frm_required">[required_label]</span>
</div>
<div class="frm_opt_container" aria-labelledby="field_[key]_label" role="group">
[input opt=1 data-results="correct" data-question="2"]
[input opt=2 data-results="wrong" data-question="2"]
[input opt=3 data-results="correct" data-question="2"]
[input opt=4 data-results="wrong" data-question="2"]
[input opt=5 data-results="correct" data-question="2"]
View appt-confirmation-email.html
Hello [confirm_name],</br>
</br>
This confirms that your appointment for your [confirm_vehicle] is scheduled for [if confirm_which_date equals="primary"][confirm_date_of_service][/if confirm_which_date][if confirm_which_date equals="alternate"][confirm_alternate_date_of_service][/if confirm_which_date].</br>
</br>
Thank you!
View display-star-icons.css
.star-rating-hover::before {
content: '\e9d9';
color: #F0AD4E;
}
.frm-star-group input[type="radio"]:checked + label::before,
.frm-star-group:not(.frm-star-hovered) input[type="radio"]:checked + label::before {
color: #F0AD4E;
}
View enable-tooltip.js
<script>
jQuery(function() {
"use strict";
$( document ).tooltip();
});
</script>