We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Hide submit button in catalog form

Abdul
Tera Contributor

i have a situation where in when a user selects no for a variable the form should not be submitted in catalog form, how can we achieve this?

1 ACCEPTED SOLUTION

miftikhar20
Kilo Patron

@Abdul ,

Create an onsubmit client script by modifying below code to prevent form submission.

function onSubmit() {
    var answer = g_form.getValue('your_variable_name'); // replace with actual variable name

    if (answer == 'no') {  // value should match the variable's internal value, not label
        alert("You cannot submit this form if 'No' is selected. Please change your response.");
        return false;  // stop submission
    }

    return true; // allow submission
}
Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

View solution in original post

1 REPLY 1

miftikhar20
Kilo Patron

@Abdul ,

Create an onsubmit client script by modifying below code to prevent form submission.

function onSubmit() {
    var answer = g_form.getValue('your_variable_name'); // replace with actual variable name

    if (answer == 'no') {  // value should match the variable's internal value, not label
        alert("You cannot submit this form if 'No' is selected. Please change your response.");
        return false;  // stop submission
    }

    return true; // allow submission
}
Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.