Hi,
I have a form with multiple linked dropdowns, an issue I have is when the user selects the first option, the second option is poputlated, if the user wants to select the first option in the second box they have to deselect the first option and reselect it. This then populates section 3 correctly.
What do I need to add to my Ajax event to add "Please Select" to be the first option. I am assuming it's to the $options options array.
Thanks in advance for your help.
Dave
I have a form with multiple linked dropdowns, an issue I have is when the user selects the first option, the second option is poputlated, if the user wants to select the first option in the second box they have to deselect the first option and reselect it. This then populates section 3 correctly.
What do I need to add to my Ajax event to add "Please Select" to be the first option. I am assuming it's to the $options options array.
<?php
$options = array();
if ( !$form->data['ajax_select_org'] || count($form->data['ajax_select_org']) < 1 ) {
// no result was found
$options[] = 'Select Above First';
} else {
foreach ( $form->data['ajax_select_org'] as $d ) {
$options[$d['id_org']] = $d['org_name'];
}
}
echo json_encode($options);
?>
Thanks in advance for your help.
Dave
Hi Dave,
Please try
Bob
Please try
$options[] = 'Select Above First';
} else {
$options[] = 'Please Select'; // << add this line
foreach ( $form->data['ajax_select_org'] as $d ) {
Bob
This topic is locked and no more replies can be posted.