The CreatorCon Call for Content is officially open! Get started here.

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

M Iftikhar
Giga Sage

@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
}

View solution in original post

1 REPLY 1

M Iftikhar
Giga Sage

@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
}