cancel
Showing results for 
Search instead for 
Did you mean: 

How to limit the length of input field

Former Member
0 Kudos

Hi,

In my adobe form there is one ISR Multiple line edit input element. If the user enters less than 2 characters, the system should

throw error saying that the length is less than 2. I guess some java scripting is needed for this.

Please help.

Thanks,

Himanshu

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Chintan,

Thanks for reminding, I have donethe same.

Cheers,

Himanshu

Former Member
0 Kudos

Thanks for all your answers.

chintan_virani
Active Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Madhu,

Thanks a lot, it worked but any idea how to give message on the top of the page(not in a popup box).

chintan_virani
Active Contributor
0 Kudos

Himanshu,

You can try out two things, see it it serves your purpose.

1. Place a ISR_TextDisplay element on top of form. Keep it invisible in by writing following code in form:ready event of subform

ISR_TextDisplay.presence = "invisible"

and and then write the code in Exit event .

var a = $.rawValue
var s = len(a)
if ( s < 2 )
then
ISR_TextDisplay.presence = "visible"
ISR_TextDisplay.rawValue = "Length is less than 2"
endif

2. Alternatively for the ISRMultipleLineEdit element goto the Object palette --> Value tab --> Change the type as User Entered Required. This will a red border if user has forgotten to enter any data in that field.

Chintan

0 Kudos

Hi

Place the below script in Exit Event of your field with Script selected as Formcalc

var a = $.rawValue

var s = len(a)

if ( s < 2 )

then

$host.messageBox("Length is less than 2")

endif

Thanks & Regards,

Madhu.

Former Member
0 Kudos

Hi Himanshu,

you may need to use form calc here for coding.

On the input field 'validate' event use the following method on the input value to check the length

Len(s) where s is the string to be examined

then you can show a message to user saying the length is less