Display message to end user while submitting the request

Jyo090
Tera Contributor

Hi Team,

 

I have a requirement to display a message to end user while submitting the request . Can you please let me anyone done this.

6 REPLIES 6

Community Alums
Not applicable

Hi @Jyo090 ,

 

You can use the onSubmit client script to show any message before submitting any request.

If you want to validate some conditions before submitting the request you can write a script check in this and if you want to reject form submission based on some validations use return false.

 

If this helps solve your query, could you mark this as correct and helpful?

 

Thanks

Anand

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Jyo090 ,

 

Can u try below script

 

function onSubmit() {

    var selectedOptions = g_form.getValue('your_field_name'); // Replace 'your_field_name' with the actual field name containing the selected options

    

    // Check if the selected options relate to an incident

    if (selectedOptions === 'incident_related_option') { // Replace 'incident_related_option' with the actual option value related to incidents

        alert("You have selected options that relate to an incident. Please use the 'Create Incident' form or, if urgent, contact the ITSD by Phone or on Teams");

        return false; // Prevent form submission

    }

    

    // Continue with form submission if options do not relate to an incident

    return true;

}

 

Thanks,

Danish