I am having problems writing a function in javascript on a PHP page that points to a select box. This if statement is to point to the select box
if (!(document.getElementById("add_product").value)==="Choose here")
Here's the code:
function promptEnrollmentMonth() {
if (!(document.getElementById("add_product").value)==="Choose here") {
var month = prompt("Is this the correct month for this course/product?", "<?php echo "$EnrollmentMonth"; ?>");
if (month !=null) {
}
}
}
<button type="submit"
onclick="promptEnrollmentMonth()">Update</button>
<div>Add course/product:<select name='add_product'>
<option selected>Choose here</option>
<option>Other options...</option>
</select></div>