It’s possible to have a password field in an spModal

dgarnica
Tera Contributor

Hi,

 

We have the requirement of encrypt the users’s input when they reject a request and write a justification in the spModal from Employee Center Approval page, it’s possible to encrypt this justification as a password field, not encrypted in the db, it’s more like when you are typing the comment in the spModal that it’s displayed when a user is rejecting the request.

 

Regards.

2 REPLIES 2

Deepak Shaerma
Kilo Sage

Hi @dgarnica 
1. Customizing the spModal Instance

When you create or customize an spModal, specify the input field for the justification as a password field. This is not standard functionality for a justification input (which would typically be a text area), so you would need to customize this part.

 

spModal.open({
    title: 'Reject Justification',
    message: 'Please enter your justification for rejection:',
    inputType: 'password', // Setting inputType to password to mask input
    buttons: [
        {label: 'Submit', value: true},
        {label: 'Cancel', value: false}
    ],
    callback: function(result) {
        // Callback function to handle the submission
        if (result) {
            var justification = result; // result contains the masked/encrypted justification
            // Proceed with any action after receiving the justification
        }
    }
});

 

Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning ‌‌
Thanks & Regards 
Deepak Sharma 


Hi Deepak,

 

I tried your script, but it doesn't let you write the justification:

 

dgarnica_1-1713540779735.png

If I set the "input" parameter to true, the textbox appears but is not encrypted:

 

dgarnica_0-1713540742920.png

 

 

 

 

Regards.