Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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
Former Community Member

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
Former Community Member

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

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----