get yes/no in client script confirmation prompt
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2018 11:50 PM
Have a client script, which on a clearing a field value , will give below confirm dialog
Is there anyway to get "yes" and "no" instaed of "ok" and "cancel"
Thanks
Labels:
- Labels:
-
Problem Management
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2021 09:51 AM
How do I view other replies?
If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2023 06:29 AM
Hi Anur,
The following code will help you to clear fields values by using confirm box / pop up box. When you'll click on 'Ok'. Your required fields values will clear. If you'll click 'Cancel' nothing will happen.
please mark my answer as accepted solution and helpful, if it works for you.
Thank you!
function onLoad() {
//Type appropriate comment here, and begin script below
var answer = confirm('Are you sure for clear field values');
if (answer == true) {
// I have selected dummy fields but you can select as per your needs
g_form.setValue('number', '');
g_form.setValue('short_description', '');
g_form.setValue('description', '');
} else {
return false;
}
}