Redirect to some custom page after catalog submission

Asad Ali1
Tera Contributor

So i have a requirement that after submitting a catalog form user should redirect to the request page if action type is "Request" and if action type is "Order now" it should redirect to some other page. is it possible? where these redirection are handled i mean in what widget?

1 REPLY 1

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Asad Ali1 ,

 

Maybe here you can try writing an onSubmit script in which u can check those conditions

 

function onSubmit() {

    var actionType = g_form.getValue('action_type'); // Replace 'action_type' with your actual field name

 

    // Check the action type and redirect accordingly

    if (actionType === 'Request') {

        // Redirect to the request page

        window.location.href = '/$sp.do?id=request_page_sys_id'; // Replace 'request_page_sys_id' with the actual ID of the request page

    } else if (actionType === 'Order now') {

        // Redirect to another page

        window.location.href = '/$sp.do?id=other_page_sys_id'; // Replace 'other_page_sys_id' with the actual ID of the other page

    } else {

        // Handle other cases or actions if needed

        // For example, show an error message for an unrecognized action type

        alert('Invalid action type selected');

    }

 

    // Return false to prevent the default form submission behavior

 

  return false;

 

Thanks,

Danish

 

}