Yes/No Confirm Message in Javascript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2012 09:43 PM
Hi,
Can anyone help out with how to get Yes/No in confirm message. If not these then at least tell me if we can make Cancel as the default value in Confirm message of java script.
I need to show this Yes/No message if user clicks on Cancel change UI action.
Currently I have just added confirm message which displays OK & cancel buttons. Over here also, user wants cancel to be a default value whereas we have Ok as an Default Value.
Thanks in Advance!
Regards,
Swity!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2012 04:28 PM
This sort of thing is best to check on a general JS site like W3:
http://www.w3schools.com/js/js_popup.asp
Checkout the confirm button section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2012 10:37 PM
Thanks matt!!
Already searched in all sites... but didn't got any so thought to ask if anyone has done like this before then it would be very helpful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2012 06:51 AM
Name: Cancel
Action Name: cancel_me
Show update & Client = checked
onClick = cancelClient()
Script:
function cancelClient(){
var ans = confirm("Are you sure?");
if(ans == false){
return false;
}
else{
gsftSubmit(null, g_form.getFormElement(), 'cancel_me');
}
}
if(typeof window == 'undefined'){
fireMeUp();
}
function fireMeUp(){
current.state = '4';
current.work_notes = "Cancelled!";
current.update();
gs.addInfoMessage('Change Cancelled.');
action.setRedirectURL(current);
}