Forum Moderators: open
fintan.
function callServer() {
// Get the Search field and search type from the web form
var getStaff = document.getElementById("getStaff").value;
var Type = document.getElementById("Type").value;<input id="Type" name="Type" type="radio" checked="checked" value="0" onclick="callServer();"> All
<input id="Type" name="Type" type="radio" value="1" onclick="callServer();"> Forename, Surname
<input id="Type" name="Type" type="radio" value="2" onclick="callServer();"> Organisational Unit
var formData = form.childNodes; // I have no idea how submitted form data is structured but I'm sure it's possible to somehow access an array of all submitted fields.
var currFormElem = null;
for (var i = 0; i < formData.length; i++) {
currFormElem = formData[i];
if (currFormElem.getAttribute("name") == "Type")
// Do whatever
}
A lot more verbose than a getElementById() call but feasible - and you could wrap all your other form handling in the same for loop if you were so inclined.
But again, this is all based on the supposition that it is the multiple id attributes that are causing the error.