Multicombobox not showing when clicking back button
I am trying to develop an online booking system that has different options for each course. When a course is selected, a combo box opens in which you select the week in which you want to take the course. There is a function to check the correctness of certain fields. If you need to go back to filling out the form, the dropdown will not be visible. Is there a way to make the combo box visible?
html as follows 1 course course 2 course 3 Choose your course ...
The selection is unloaded from Wordpress like this:
<input type="hidden" name= "course1a" value="<?php echo $title;?>,<?php echo the_field('cost_of_course',$week1a); ?>" />
<select name="date1a" id="date1a">
<option value="">Select Week</option>
<?php
$categories =get_the_category($week1a);
foreach ($categories as $category) {
if($category->name !== '6 +')
if($category->name !== '7+')
if($category->name !== '8+')
if($category->name !== '9+')
if($category->name !== '10 +')
if($category->name !== '11+')
if($category->name !== 'All')
$option = '<option value="'.$category->cat_name.'">';
$option .= $category->cat_name;
$option .= '</option>';
echo $option;
}
?>
The Javascript handling this looks like this:
function showWeek(str) {
if (str == "") {
document.getElementById("txtHint").innerHTML = "";
return;
} else {
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET","dates.php?week="+str,true);
xmlhttp.send();
}
}
Any thoughts on how we can make the dropdown menu clickable.
Booking systemhttps://www.chiswickcourses.co.uk/wp/online-booking/
Greetings
Yang
source to share
No one has answered this question yet
Check out similar questions: