I am having an issue with my Form Submit function
Everything is submitting as expected other than the 'Option' from my 'Select'.
It is getting passed through as 'Undefined'
I'm wondering if this is because the Options in the select are generated programmatically at runtime?
My code for the select is:
<label for="devname">Developer Name:</label>
<select id="devname" name="devname">
<option value="">Choose name..</option>
</select><br><br>
The code i've got that generates the options is:
function populateSelect() {
$.get('/GetDevs').done(function (devs){
var index = 0;
var selectme = document.getElementById('devname');
for (index = 0; index < devs.length; ++index) {
var dev = devs[index];
var opt = document.createElement('option');
opt.value = dev.Devid;
opt.innerHTML = dev.dname;
selectme.appendChild(opt);
}
});
}
populateSelect();
This successfully populates the option but as i say, when i post the form it gets passed 'undefined'
Any ideas would be appreciated