Click to See Complete Forum and Search --> : Alert Messages - Khalid, please help


mh53j_fe
07-28-2003, 02:22 PM
Permissions for text box are set using JS function Validate_Champion() listed below.
User doesn't have permissions to change a value in a text box. After changing value and
tabbing out, JS launches alert message "Permission denied to edit the Champion". User then
goes back to the text box, changes the value again and tabs out. This time, the application
does not launch the alert message even though the text box reverts back to the saved value.
How can I make sure that my code will launch the alert message every time the user tabs out of this
box (when they do not have permission to change the value).

// 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
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


The above function is called in this cgi module:

<td colspan="1"><input type="text" name="CHAMPION_CODE" value="$CHAMPION_CODE"
size="6" maxlength="5" onChange="Validate_Champion(this,1,1);">

Khalid Ali
07-28-2003, 02:59 PM
post your full related javascript code.
and the html code that causes these alerts..or better post the linkof the actual pages where its implemented.

HKRS CLAN
07-28-2003, 05:49 PM
IM gonna run:
HKRS JAVA/HTML TESTER/DEBUGGER
simply named:
"HKRS WEBPRO V7.001"

im gonna copy its results list to this post.....
-----------------------------------------------
RESULTS
&800HKRSWEBPRO
ERROR:
java scripting was ended uncomplete at:
VALIDATE_CHAMPION %27enter_text AK_tab_out
........
ENGLISH RESULTS........
"THE JAVA SCRIPT SET WAS UNCOMPLETE!"
UNABLE TO DEBUGG WITHOUT FARTHER SCRIPT.
[ok]
-----------------------------------------------------
this mean basicly that wat the above person said before..
you havent gave us the whole script!!!!