Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Help with response box cancel button.

Avatar

Level 1

Hi,

I'm hoping for a bit of help here .

I'm a very, very new to LC Designer and I'm creating a form that has a check box on it. What I'm trying to achieve is, when the user clicks on the check box a response box appears asking them to enter a value i.e. £100. When they click ok this value is entered into a textfield, now this part I have managed to achieve with this formcalc script:

----- form1.#subform[0].Insurance::click - (FormCalc, client) --------------------------------------

form1.InsValue = xfa.host.response("Please enter the required amount of insurance cover for your item in the box below.","Required Insurance")

My problem now though is that if the user clicks on the cancel button nothing is obviously entered into the textfield but the checkbox remains checked, if possible I'd like to have the check box deselected when the user clicks cancel.

Many thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 6

It is very easy to do........I would tweek your code as follows..........

----- form1.#subform[0].Insurance::click - (FormCalc, client) --------------------------------------

var amt

amt = xfa.host.response("Please enter the required amount of insurance cover for your item in the box below.","Required Insurance")

if amt <> "" then

     form1.InsValue = amt

else

     $.rawValue = 0; //will set chekbox unselected

endif

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

It is very easy to do........I would tweek your code as follows..........

----- form1.#subform[0].Insurance::click - (FormCalc, client) --------------------------------------

var amt

amt = xfa.host.response("Please enter the required amount of insurance cover for your item in the box below.","Required Insurance")

if amt <> "" then

     form1.InsValue = amt

else

     $.rawValue = 0; //will set chekbox unselected

endif