Hi all. I am working with combo boxes and need to display a message on the screen warning about consequences of any change. The user will then decide if he/she wants to go ahead. anybody have any idea how i can produce the message box on the screen without
loosing the page. thnx
You can use the Javascript confirm() function which will display a message box with and OK and CANCEL button. If OK is clicked then it will return true and if CANCEL is clicked then it will return false.
if ( !confirm("Are you sure you want to make changes?\r\n\nClick OK to save your changes or click CANCEL to cancel the save action.") )
{
// they clicked Cancel, so return to the calling form a block submit
return false;
}
else
{
// they clicked Ok, so continue
return true;
}
siddiq
Member
15 Points
3 Posts
invoking a dialog box
Oct 30, 2003 12:17 PM|LINK
wes holden
Participant
1698 Points
359 Posts
Re: invoking a dialog box
Oct 30, 2003 02:32 PM|LINK
if ( !confirm("Are you sure you want to make changes?\r\n\nClick OK to save your changes or click CANCEL to cancel the save action.") ) { // they clicked Cancel, so return to the calling form a block submit return false; } else { // they clicked Ok, so continue return true; }-----------------------------