mh53j_fe
07-28-2003, 07:09 AM
Please help! User doesn't have permissions to change a value in a text box. When he or she tabs out, the app launches an alert message. However, the second ( or more) time the user tries to change the value, the app does not launch an alert message. Any suggestions will be highly appreciated!!
// Validates the Champion Code text box
function Validate_Champion( field, fGetDesc,security)
{
if((S_A_72Hr == "true")||(S_A_Champion == "true")) //does the user have permissions?
{
if( isblank( field ) )
{
alert ( "Error: Champion must be entered" );
field.focus();
return false;
}
if ( fGetDesc == 1 ) //user is tabbing out of field - fGetDesc ==1
{
getDesc('CHAMPION_DESC',
"Select champion_desc CHAMPION_DESC, role ROLE from champion where
champion_code not in \('0000'\) and valid1 in \('Y'\) and " + Champion_Where_Cla
use + " and champion_code=",
field.value,
'Incorrect Champion ',
'dummy',
'CHAMPION_CODE',
'');
}
return true;
}
//Here is where my problem is. User doesn't have permissions to change the champion code. He or she changes the
//code and when tabbing out, JS launches alert message. However, if I go in to the text box and try to change the
//champion code again, JS does not launch an alert message. However, the value does revert to the original value.
//I want the code to launch an alert message each time the user tries to enter a value that they do not have permissions for/
else
{ if(security != 0) //User doesn't have permissions
alert("Permission denied to edit the Champion ")
field.value=unescape(top.data.vehdetAry[COUNTER].CHAMPION_CODE);
return true;
}
} // end Validate_Champion
// Validates the Champion Code text box
function Validate_Champion( field, fGetDesc,security)
{
if((S_A_72Hr == "true")||(S_A_Champion == "true")) //does the user have permissions?
{
if( isblank( field ) )
{
alert ( "Error: Champion must be entered" );
field.focus();
return false;
}
if ( fGetDesc == 1 ) //user is tabbing out of field - fGetDesc ==1
{
getDesc('CHAMPION_DESC',
"Select champion_desc CHAMPION_DESC, role ROLE from champion where
champion_code not in \('0000'\) and valid1 in \('Y'\) and " + Champion_Where_Cla
use + " and champion_code=",
field.value,
'Incorrect Champion ',
'dummy',
'CHAMPION_CODE',
'');
}
return true;
}
//Here is where my problem is. User doesn't have permissions to change the champion code. He or she changes the
//code and when tabbing out, JS launches alert message. However, if I go in to the text box and try to change the
//champion code again, JS does not launch an alert message. However, the value does revert to the original value.
//I want the code to launch an alert message each time the user tries to enter a value that they do not have permissions for/
else
{ if(security != 0) //User doesn't have permissions
alert("Permission denied to edit the Champion ")
field.value=unescape(top.data.vehdetAry[COUNTER].CHAMPION_CODE);
return true;
}
} // end Validate_Champion