Connecting a Select Field to another field

Sanya Afolabi created the topic: Connecting a Select Field to another field

Hi,
I need to connect a select field to another field in order to fetch data. I have already written the codes but which of the .php files would I edit and what part of the file will I insert the codes?

Regards,
Sanya

#21114

Please Log in or Create an account to join the conversation.


Sanya Afolabi replied the topic: Connecting a Select Field to another field

Here is the code:

if ($row->id == 15) {
$query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=13 AND element_label=1";
$category_names = $wpdb->get_col($query);
$category_options = '';
foreach ($category_names as $key => $category_name) {
if ($category_name != '') {
$category_options .= '<option onselect="set_select(\'1_option0' . ($key + 1) . '\')" value="' . $category_name . '" id="1_option0' . ($key + 1) . '">' . $category_name . '</option>';
}
}
// var_dump(esc_html($row->form_front));
// $row->form_front = preg_replace('/<select id="1_element15"(.*?)<\/select>/', 'b<select id="1_element15" name="1_element15" style="width: 200px;" onchange="set_select(this)"><option id="1_option0" value="" onselect="set_select(\'1_option0\')" selected="selected">Select value</option>' . $category_options . '</select>', $row->form_front);
$row->form_front = str_replace('<select onchange="set_select(this)" style="width: 200px;" name="1_elementform_id_temp" id="1_elementform_id_temp">', '<select onchange="set_select(this)" style="width: 200px;" name="1_elementform_id_temp" id="1_elementform_id_temp">' . $category_options, $row->form_front);
}

#21117

Please Log in or Create an account to join the conversation.


Support replied the topic: Connecting a Select Field to another field

Dear Sanya,

If this requirement is not very urgent, please make sure to contact us after January 6th. Our development team will be available then and we will be able to discuss this with them.

Thank you.


Best regards,
Web-Dorado team


Joomla extensions ,
Wordpress plugins ,
Drupal modules
#21194

Please Log in or Create an account to join the conversation.


Time to create page: 0.184 seconds
Powered by Kunena Forum

WORLD-CLASS SUPPORT

We are here for you every step of the way. Turn to our support with any questions you might have about our products and services. Our experienced customer care team is available to help you as fast as we possibly can.

Contact us