Possibility to set default values | Formidable Plus | Forum

This forum requires Javascript to be enabled for posting content

 

Current User: Guest
Login
Members
Please consider registering

Lost Your Password?

Search Forums:

 










Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Possibility to set default values

Reply to Post
Add a New Topic
No Tags
User Post

3:55 pm
January 21, 2012

David _

Member

posts 7

Wondering if that is possible in the setup for a table.

example question

on scale of 1-5 with an n/a selected by default

1 2 3 4 5 n/a

Thanks,

David20

11:56 am
January 25, 2012

Top Quark

Barrie, ON

Member

posts 83

Hi David,

There's nothing in the Formidable Plus interface that allows for default values as you describe (though good suggestion).  I think it could be accomplished with the Formidable filter `frm_setup_new_fields_vars`.  It might look something like this:

add_filter('frm_setup_new_fields_vars','topquark_test',10,2);
function topquark_test($field_array,$field){
 if ($field->id == '86'){ // Change to your field id
   // Note, you'll need to update the value.  The value needs to be an
   // array of arrays.  Each array within the larger array represents a
   // row, and each value represents a column on that row.
   // So, say your example had 1 row with 2 columns and the 1-5 scale appears in the
   // second column.  You would do this:
   $field_array['value'] = array(array('','n/a'));
 }
 return $field_array;
}

You could put such a function into a plugin or the functions.php file of your theme.

Cheers
Trevor 

1:24 pm
January 25, 2012

David _

Member

posts 7

Thanks, I can certainly work with that.  cheers.

No Tags
Reply to Post

Reply to Topic:
Possibility to set default values

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

Smileys
Confused
Cool
Cry
Embarassed
Frown
Kiss
Laugh
Smile
Surprised
Wink
Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
6 + 8
   

© Simple:Press