cancel
Showing results for 
Search instead for 
Did you mean: 

Restriction of length in input field

Former Member
0 Kudos

hi

I want to restrict the UI element "Input Field " Character length..

For Ex

I had taken Label "Name" ....i given input field.....But its allowing 'n' num of characters in that field.

I want to restrict those characters to 10.

Is it possible with property settings in web dynpro or we have to write code for that.

If thats the case,,Please provide the code.

Thanks in advance

Regards

Sushma

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi susma,

you want to restrict the size of inputfiled as ao characher ..

go to --Dictinary block where you created Simple Type..

you have to create one simple type as inputlength.

after created you have number of tab at below..

select the DEFINITION TAB-chose-Maximum length --10..then save it

after that you have to set input attribute as data type as simple type which created for restrict the length

Go to Attribute value as input-go to property-choose TYPE property of INPUT Attribute---set Your simple Type as inputlength.

hope this will wark

thanks

jati

pravesh_verma
Active Contributor
0 Kudos

Hi Sushma,

For this you have to create a simple data type. No need of writing a code.

Go to Dictionaries -> Local Dictionary -> Data Type - > Simple Type - > Right click and "Create Simple Type".

Here you should create a Simple type with String as built-in Type. Here you will also see the Length Constraints option.

Set the value of maximum length and minimum length. In your case set the value of maximum length to 10. At runtime this will not allow the user to enter more than 10 characters.

Now create an attribute and bind it to this newly created simple type. Bind the value of the input field with this particular attribute.

I am sure this will solve your problem. Please revert back in case you need any further help!

Thanks and Regards

Pravesh