I am trying to call a function when the submit button is pressed and send this function the value of one of the drop downs in the form. Here is my code:

The Functions:

function getDelegateId() {
return #getfromjaRes.assignedTo#;
}

function getDelegateName() {
var name = "#getCurrentDelegateName.firstname# + " " + #getCurrentDelegateName.lastname#";
return name;
}


function delegateTrigger(delegateLov) {
var delChoice = delegateLov.options[delegateLov.selectedIndex].value;
var delChoiceName = delegateLov.options[delegateLov.selectedIndex].text;
if (getDelegateId() != 0) {
if (delChoice != getDelegateId() && hasConfirmedToChangeDelegate == false) {
choice = confirm("Are you sure you want to change current delegate from " + getDelegateName() + " to " + delChoiceName + "?");
if (choice == false) {
selectUserInRecord();
} else {
hasConfirmedToChangeDelegate = true;
}
}
}
}


The HTML:

<input type="submit" name="Delegate" value="Delegate" tabindex="6" onClick="delegateTrigger(document.getElementById("DelegateUser").text)" <cfif #getfromRes.status# eq 'PUBLISHED'>DISABLED</cfif>>

I get no alert box when I should get one? Am I able to pass the text value of a specific drop down to the function as I tried on the submit button? Also, Can I return a variable called "name" by typing: return name; or is my syntax incorrect? Thank you.