I have done some research on this and everything said / suggested so far has failed to work.
I am trying to capture the input from a select tag, however nothing comes through, not even null.
The code:
function validateForm()
{
var name = $('#txtName').val();
var email = $('#txtEmail').val();
var tel = $('#txtTel').val();
var look = $('#lookingFor').val();
var goals = $('#goals').val();
alert(name + " " + email + " " + tel + " " + look + " " + goals);
return false;
}
HTML:
<select class="fomForm select" style="color:#777;"
id="lookingFor" name="lookingFor">
<option value="">I'm looking for</option>
<option value="">CYCLING</option>
<option value="">RUNNING</option>
<option value="">TRIATHLONS</option>
<option value="">TRAINING CAMPS</option>
<option value="">PERFORMANCE TESTING</option>
<option value="">DIET & NUTRITION</option>
<option value="">WELLNESS</option>
</select>
I apologise for asking this as there are quite a few resources on the internet however they don’t seem to help this case. The name, email etc all display fine in the alert but the select boxes do not.
I have no errors in the console.
you have no value in your select box option…so the alert is empty
replace the value with the value u want….