The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Same form, Different defaults on different pages?

Labels

This Discussion is public

Notifications

Hi guys,

Formidable is working out great so far. I'm hoping to have a common form across multiple pages, but have certain defaults change depending upon what page it's accessed from.

Ideally it would be something that allowed me to say eg. [defaultLocation: /defaults/$thispage/default1.txt] rather than parsing the values to the via the location bar.

Does anyone have any ideas how one might approach this?

Thanks

Lachlan

So far I've added this to my code snippets :

add_filter('frm_get_default_value', 'my_custom_default_value', 10, 2);
function my_custom_default_value($new_value, $field){
if($field->id == 25){
$new_value = "New DEFAULT";
}
return $new_value;
}

And in the default on the form I add [frm_get_default_value]

This works, however it would be great to be able to call this like:
[frm_get_default_value defaultCategory="category 5"]

then instead of "if $field->id" it was "if defaultCategory = "category 5"

is this possible?

I also notice that if you use this method for HTML it overwrites all HTML and puts it outside of the form div. (so can't be hidden conditionally) Should I be using a different method for HTML?

Thanks

Discussion closed.