Expand my Community achievements bar.

SOLVED

Specific range of numbers

Avatar

Level 2

Hello there,

I have a numeric field, and I would like to enter a specific numbers in this field; numbers between 10 to 40.

How can this be achieved?

Kindly note that I'm new to Livecycle Designer.

Thank you in advance,

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

On the exit event of the field you woudl have to write code that will check that the user entered a number in that range. Something like this javascript here:

if (this.rawValue < 10 || this.rawValue > 40) {

     app.alert("You have entered a number that is outside of the acceptable range. It must be between 10 and 40. Please try again");

     xfa.host.setFocus("Insert name of your field here");

}

Hope that helps

Paul

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

On the exit event of the field you woudl have to write code that will check that the user entered a number in that range. Something like this javascript here:

if (this.rawValue < 10 || this.rawValue > 40) {

     app.alert("You have entered a number that is outside of the acceptable range. It must be between 10 and 40. Please try again");

     xfa.host.setFocus("Insert name of your field here");

}

Hope that helps

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