how can make input non mandatory in sp modal
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2023 06:12 AM
I am building the similar functionality in todo's for approval requests. currently we have if click on reject it opens the below pop-up
I want similar functionality for Approve Request also, when user click on approve request it should open popup, I am able to open the popup but I want if user doesn't enter comments while approving then also it should go ahead and approve the request but its not happening like that.
I am using spmodal in client controller to achieve this:
spModal.open({
title: c.data.CONST.i18n.APPROVE_MODAL_TITLE,
message: c.data.CONST.i18n.APPROVE_MODAL_MESSAGE,
input: true,
buttons: [{
label: c.data.CONST.i18n.REJECT_MODAL_CANCEL,
cancel: true
},
{
label: c.data.CONST.i18n.APPROVE_MODAL_SUBMIT,
primary: false,
}
]
}).then(function(comments) {
if (c.data.esignRequiredObj.e_sign_required) {
openEsignatureModal(state, c.data.comments);
}
else {
alert("hi");
//sendUpdateRequest(state, c.data.CONST.ACTION, c.data.comments);
}
});
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 05:34 AM
Hi ,
Try using the below variable for answer:
const answer = spModal.open({
title: title,
label: title,
message: message,
input: {
type: "text",
value: comment,
required: false // This makes the comment box non-mandatory
},
buttons: [{
label: "${Cancel}",
cancel: true
},
{
label: primaryButtonLabel,
primary: true
}
]
});
Please mark answer as Helpful if it works.