Expand my Community achievements bar.

SOLVED

Problem with hidden field in form initialize

Avatar

Level 1

Hi

I'm new to using LiveCycle to create forms and i'm trying to figure why my script is not behaving the way i want it to.

Basically what i want is a Text field called StatusOther to appear invisible or hidden when the form is opened. I then have a dropdown box with a few selections and i want to have the text field appear only when certain selections are made.

I have gotten the script for the dropdown box to work correctly, HOWEVER, if i set the presence field of the text field to hidden or invisible in the initialize call i can not get the field to reappear when the dropdown script kicks in. It simple remains hidden. I'm not sure if this is a bug or what.

What i have done as a test is modified my code to simply initialize the field (not hiding it) with some text and then have the dropdown script update the value of the text field when it kicks in. This works fine as expected. Am I missing something when dealing with the presence field???

Here's the code:

CISFormEnglish.CISFormPage1.EmployeeStatus::exit - (FormCalc, client)

// Enable "specify field" if asterisk and end-parenthesis is detected in selection.

if (Right($.rawValue, 2) == ")*") then CISFormEnglish.CISFormPage1.StatusOther.presence = "visible" else CISFormEnglish.CISFormPage1.StatusOther.presence = "invisible" endif

CISFormEnglish.CISFormPage1.StatusOther::initialize - (FormCalc, client)

// Hide the field when form initializes.

$.presence = "invisible"

Thanks

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Did you save your form as a Dynamic PDF?

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Did you save your form as a Dynamic PDF?

Paul

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] ----