Class Detail

Class Name:FrmProFieldSettings
Declaration:
class FrmProFieldSettings
Where found:
formidable-pro/classes/models/FrmProFieldSettings.php
Pro class:
Yes
Extended By:

Contribute Comments or Examples

Codex Comments/Examples

Yes, this form works!

Please do not 'test' this form! We get way too many fake entries. If you are not contributing any helpful content and make a fake entry, we shall block your IP address from accessing this site in the future.

If you are genuinely contributing to this content, your entry will appear below this form after it is approved by an admin.

First
Last
Mastermind Contributor: Lisa Thrower

At the risk of doubling up (also posted on the filter) I thought I'd share a useage for this function in a filter. It is one someone asked for help with in the slack group. It adds field validation to make sure the user is entering a higher value than any previously entered. It uses FrmEntryMeta::get_entry_metas_for_field to get the existing entry values.

add_filter('frm_validate_field_entry', 'require_higher_bid', 10, 3);
function require_higher_bid($errors, $posted_field, $posted_value){
if ( $posted_field->id == 25 && $posted_value != '' ) { //change 25 to the ID of the field to change
$previous_bids = FrmEntryMeta::get_entry_metas_for_field( $posted_field->id ) ;//returns all of the meta values of the existing entries in this field as an array.
$high_bid = max($previous_bids); //sets the high_bid variable as the highest value in the previous_bids array
if ($posted_value id] = 'Looks like you have been outbid! Raise your bid and try again!';
}
return $errors;
}

Mastermind Contributor: Lisa Thrower

I helped someone with this in the slack group so thought I would put it here as well. It adds field validation to make sure the user is entering a higher value than any previously entered. It uses FrmEntryMeta::get_entry_metas_for_field to get the existing entry values.

add_filter('frm_validate_field_entry', 'require_higher_bid', 10, 3);
function require_higher_bid($errors, $posted_field, $posted_value){
if ( $posted_field->id == 25 && $posted_value != '' ) { //change 25 to the ID of the field to change
$previous_bids = FrmEntryMeta::get_entry_metas_for_field( $posted_field->id ) ;
$high_bid = max($previous_bids);
if ($posted_value id] = 'Looks like you have been outbid! Raise your bid and try again!';
}
return $errors;
}