Expand my Community achievements bar.

SOLVED

Problem verifying entry in text field and requiring option in drop down field

Avatar

Level 7

I have a form with several fields that if the user enters any information in one or more of the

fields, I need to verify that the drop-down field is not blank.

I got that to work, but now I find that if the user deletes the text in the text field, the user still gets the error message. Here's the script I'm using:

if

((form1.page1.ListFilesFolders.rawValue) != null && (form1.page1.windsNtwkAccess.rawValue) == null);

{

xfa.host.setFocus(form1.page1.windsNtwkAccess);

xfa.host.messageBox("Please make a selection in the Windows Network field."

, "Need Selection", 1,0);

}

Thanks,

MDawn

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Makes sense ..the field is null when the user deletes the text. You could put a blank in those fields as defaults and test for that instead of null. Now when the user empties the field it will be null and will not be blank hence the message will not appear.

Make sense?

Paul

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Makes sense ..the field is null when the user deletes the text. You could put a blank in those fields as defaults and test for that instead of null. Now when the user empties the field it will be null and will not be blank hence the message will not appear.

Make sense?

Paul

Avatar

Level 7

I'll try that. Thanks for your quick reply.

Margaret Dawn

Supervisor - Documentation

W: 630-850-1065

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