Home › Forums › Quform WordPress › form dropdown.
- This topic has 7 replies, 2 voices, and was last updated 11 years, 2 months ago by radacla.
- AuthorPosts
- November 8, 2013 at 6:06 am #7310radaclaParticipant
Hello, I wanted to know if it was possible to take the data entered in the database and place it in a form dropdown.
thanksNovember 10, 2013 at 11:21 am #7326AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 10, 2013 at 2:41 pm #7330radaclaParticipantYes, thank you, I tried but I would like to show all the fields in a table.
this is what I added to myself.
function enterreport_dynamic_dropdown_values($form)
{
$options = array();
$dbc = mysqli_connect('localhost', 'xxxxxxx', 'xxx', 'bresaola_wor2');
$query = "SELECT * FROMukz_iphorm_form_entry_data`";
$result = mysqli_query($dbc, $query);while ($row = mysqli_fetch_assoc($result)) {
$options[] = array('label' => $row['CLIENTE'], 'value' => $row['CLIENTE']);
}$dropdown = $form->getElement('iphorm_12_22');
if ($dropdown instanceof iPhorm_Element_Select) {
$dropdown->setOptions($options);
}
}
add_action('iphorm_pre_display_12', 'enterreport_dynamic_dropdown_values');
I would not only show the label and value, but all fields included in element_id.
thanks Claudio
November 12, 2013 at 10:27 am #7343AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 12, 2013 at 10:31 am #7344radaclaParticipantOk thanks solved, but if I wanted to retrieve data in a single line text how can I do?
eg:
Single line text 1 product
Single line text product 2November 12, 2013 at 12:42 pm #7353AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 12, 2013 at 12:42 pm #7354AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 12, 2013 at 2:39 pm #7355radaclaParticipantOk thanks solved
Regards
Claudio - AuthorPosts
- You must be logged in to reply to this topic.