These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Require a user to put in a minimum number

dmknight
Registered: Sep 17 2009
Posts: 6

I need a numeric field in a LiveCycle form to require that a user put in a number no less than 35, but the validation does not seem to allow me to do this. I want an error message to appear if it is blank or an amount lower than 35 is entered.

This seems so simple, do I need script for this? If so what do I need and for future reference, what is the easiest way to determine what script is needed? I have been all over the help page and the web.

Thanks for your help.

DK

xrum
Registered: Feb 25 2009
Posts: 124
on exit event:

if this.rawValue < 35
{
app.alert("Must be larger then 35")
}
dmknight
Registered: Sep 17 2009
Posts: 6
This is not working. I'm sure I'm doing something wrong. could you give me more detailed instruction on what I need to do?

Thanks for your response.

DK
xrum
Registered: Feb 25 2009
Posts: 124
can you attach a sample form?
lkassuba
ExpertTeam
Registered: Jun 28 2007
Posts: 3636
The easiest way to attach a sample form is to share it on Acrobat.com (free service) and reference it in your post.

Lori Kassuba is an AUC Expert and Community Manager for AcrobatUsers.com.

dmknight
Registered: Sep 17 2009
Posts: 6
Here is the link for the form: https://share.acrobat.com/adc/document.do?docid=e9f1090b-a7b2-4241-af9b-b9e2cf3d1a71

The problem is in Section 1 where is says: List percentage eligible. That needs to require users to input 35 or more, but no number less than 35.

Thanks,

DK
xrum
Registered: Feb 25 2009
Posts: 124
if (this.rawValue < 35)
{
app.alert("Must be larger then 35")
this.rawValue=""
xfa.host.setFocus(this)
}



for future debugging, either make sure your javascript debugger is turned on, or use the little green checkbox to validate your code :) (it's on top, to the right of the event selection drop down :)


good luck :)