- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 02:50 AM
How do I remove a text area and fix the "Save" function so data is saved properly?
This My UI Action
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 04:31 AM
Hi @yana7
Configure the UI Action as below for your requirement :
function onSubmit() {
var gm = new GlideModal('cancelTask');
//Sets the dialog title
gm.setTitle('Confirmation');
//Set up valid custom HTML to be displayed
gm.renderWithContent('<div style="padding:15px"><p>Apakah anda yakin akan menyimpan perubahan?</p><button style="padding:5px;margin-right:10px" onclick="window.changeTaskAction(this.innerHTML,jQuery(\'#taskCancellation\').val())" class="btn btn-default">Cancel</button><button style="padding:5px" class="btn btn-primary" onclick="window.changeTaskAction(this.innerHTML,jQuery(\'#taskCancellation\').val())">Ok</button></div></div>');
//We'll use the windows object to ensure our code is accessible from the modal dialog
window.changeTaskAction = function(thisButton, thisAction) {
//Close the glide modal dialog window
gm.destroy();
//Submit to the back-end
if (thisButton == 'Ok') {
g_form.save();
g_form.addInfoMessage('Data berhasil disimpan');
}
};
return false; //prevents the form from submitting when the dialog first loads
}
Output -
Please note that you can change the UI Action Name as per your requirement.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 04:01 AM
Hi @yana7
Below post could be helpful :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 04:31 AM
Hi @yana7
Configure the UI Action as below for your requirement :
function onSubmit() {
var gm = new GlideModal('cancelTask');
//Sets the dialog title
gm.setTitle('Confirmation');
//Set up valid custom HTML to be displayed
gm.renderWithContent('<div style="padding:15px"><p>Apakah anda yakin akan menyimpan perubahan?</p><button style="padding:5px;margin-right:10px" onclick="window.changeTaskAction(this.innerHTML,jQuery(\'#taskCancellation\').val())" class="btn btn-default">Cancel</button><button style="padding:5px" class="btn btn-primary" onclick="window.changeTaskAction(this.innerHTML,jQuery(\'#taskCancellation\').val())">Ok</button></div></div>');
//We'll use the windows object to ensure our code is accessible from the modal dialog
window.changeTaskAction = function(thisButton, thisAction) {
//Close the glide modal dialog window
gm.destroy();
//Submit to the back-end
if (thisButton == 'Ok') {
g_form.save();
g_form.addInfoMessage('Data berhasil disimpan');
}
};
return false; //prevents the form from submitting when the dialog first loads
}
Output -
Please note that you can change the UI Action Name as per your requirement.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.