Hi,
I have five select boxes on my ASP web page of which i would like to check against the logged in user id and verify whether or not they are allowed to sign off this particular form. My five select boxes contain a number of different users.
My problem arises when the first select box 1 is signed off by user A. Then user B logs in and trys to sign off select box 2, my code below continues to check select box 1 against the logged in user which i dont want to happen. I know this might sound complicated! So if anyone has any suggestions that would be greatly received. Thanks
I have five select boxes on my ASP web page of which i would like to check against the logged in user id and verify whether or not they are allowed to sign off this particular form. My five select boxes contain a number of different users.
My problem arises when the first select box 1 is signed off by user A. Then user B logs in and trys to sign off select box 2, my code below continues to check select box 1 against the logged in user which i dont want to happen. I know this might sound complicated! So if anyone has any suggestions that would be greatly received. Thanks
Code:
<script language="JavaScript" type="text/javascript">
<!--
function validateMyForm3() {
with (document.form4) {
var juserid = "<%=Session("userid")%>";
var ja2eng = "<%=a2eng%>";
var ja2qua = "<%=a2qua%>";
var ja2man = "<%=a2man%>";
var ja2plan = "<%=a2plan%>";
var ja2purch = "<%=a2purch%>";
var alertMsg = "You are not authorized to sign off:\n";
if ((selA2Eng.value != "Please Select...") || (ja2eng.value == ""))
{
if (selA2Eng.value != juserid) alertMsg += "\nEngineering";
}
if ((selA2Qua.value != "Please Select...") || (ja2qua.value == ""))
{
if (selA2Qua.value != juserid) alertMsg += "\nQuality";
}
if ((selA2Man.value != "Please Select...") || (ja2man.value == ""))
{
if (selA2Man.value != juserid) alertMsg += "\nManufacturing";
}
if ((selA2Plan.value != "Please Select...") || (ja2plan.value == ""))
{
if (selA2Plan.value != juserid) alertMsg += "\nPlanning";
}
if ((selA2Purch.value != "Please Select...") || (ja2purch.value == ""))
{
if (selA2Purch.value != juserid) alertMsg += "\nPurchasing";
}
if (alertMsg != "You are not authorized to sign off:\n") {
alert(alertMsg);
return false;
} else {
return true;
} } }
//-->
</script>