hazelsisson
Programmer
Hello!
Here's the problem: I want to send a javascript variable via a html form by using a hidden value, but the value doesn't get sent as it should and only the default value, "TEST" gets sent.
The javascript function, "delUser" is:
The html form is:
The javascript alert box displays the variable correctly, so there is some reason that the form is not including it when it is submitted. Everything else works OK, i.e. the correct location is reached on submitting.
Any ideas where I may be going wrong!?
Thank-you,
Hazel
Here's the problem: I want to send a javascript variable via a html form by using a hidden value, but the value doesn't get sent as it should and only the default value, "TEST" gets sent.
The javascript function, "delUser" is:
Code:
function delUser()
{
var removeUserid = document.privForm.privUsers.options[document.privForm.privUsers.selectedIndex].value;
alert ("removeUserid = " + removeUserid);
var myConfirm = confirm("Are you you want to remove " +document.privForm.privUsers.options[document.privForm.privUsers.selectedIndex].text+ " from the list of users?");
if (myConfirm == true)
{
document.remForm.submit();
}
else
{//nothing
}
}
The html form is:
Code:
<FORM NAME="remForm" ACTION="...removeUser" ONSUBMIT="remForm.myRemove.value= removeUserid;">
<INPUT TYPE="HIDDEN" NAME="myRemove" VALUE="TEST">
<INPUT TYPE="BUTTON" VALUE="Remove User" onClick="delUser();">
</FORM>
The javascript alert box displays the variable correctly, so there is some reason that the form is not including it when it is submitted. Everything else works OK, i.e. the correct location is reached on submitting.
Any ideas where I may be going wrong!?
Thank-you,
Hazel