Getting Selectbox Option Value from Entry_ID

By: Craig Van Der Linden | Asked: 07/05/2023
ForumsCategory: Code HelpGetting Selectbox Option Value from Entry_ID
Craig Van Der Linden asked 1 year ago
I am able to get the option "label" using:
FrmProEntriesController::get_field_value_shortcode( array( 'field_id' => $field_id, 'entry' => $entry_id ) )
However, that appears to return me the "Label" of the option, not the actual "value" The HTML code for an example option looks like:
<option value="13590">The label of the option</option>
The code above would return: "The label of the option" I am looking for it to return: "13590"
Victor Font replied 1 year ago

Are you sure the value in the database is 13590? Check the value in the wp_frm_item_metas table to make sure that's what's stored in the data row for this field and target item_id.

Victor Font replied 1 year ago

Different values are stored by different field types. A Dynamic drop down stores the record ID of the lookup table row. All other drop downs store the text label.

Craig Van Der Linden replied 1 year ago

Not sure what is happening however, I was able to get the correct value using the $_POST['item_meta'] data for that field in the frm_after_create_entry action.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right