Create a popup box for a catalog item

Cupcake
Mega Guru

I have a catalog form that contains a field asking what type of member are you trying to Onboard, I want to create a confirmation popup box that says something like "Are you sure this is the type of member you want to onboard? ". I would like the confirmation pop up to be a Yes or No, and if No then reset that field back to the default of "none". I want the pop up to occur upon Submission of the form or is there a way to have it appear after one of the selections is made.

find_real_file.png

I know that I can use a confirm type of script like: confirm("Hello World"); Will pop up a window with "Hello World?" and a 'Ok' and 'Cancel' buttons.

Is that done thru the gs.addInfoMessage("Hello World"); Will put "Hello World" on the top of the screen

Please assist if you can and I will need some assistance with the javascript that may be required.

Thanks again.

Karen

1 ACCEPTED SOLUTION

joshua_bice
Giga Expert

onChange client script for the field in question. Here's the code:



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


        if (isLoading || newValue == '') {


                  return;


        }



        var con = confirm("Are you sure this is the type of member you want to onboard?");



        if(con == false)


                    control.value = oldValue; //This can also be simply an open and close apostrophe '' to bring it back to None.


}



That should do it for you.


View solution in original post

7 REPLIES 7

Joshua may I ask another question. There is a need to SAVE the form before it is submitted just in case the customer needs to come back to the form at a later time.


Is there an easy way to do this?


Of course, that's out of the box functionality. This is actually built into the Service Catalog by updating your cart. You can navigate to your cart later and finish filling out the form/ordering it.


I think someone removed it or turned it off. There are no options for the customer to save the cart


find_real_file.png