cancel
Showing results for 
Search instead for 
Did you mean: 

restrict input field size

Former Member
0 Kudos

how can i restrict the size of an InputField to 100 characters?

Nikhil

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Nikhil

1) first create a Simple Type Using dictionaries in the tree structure

2)switch to representation tab and there u can set the maximum length

3)create a context and select type--> set with corresponding data type

4)now bind your input field with your the context.

regards

ambicasony

sid_sunny
Contributor
0 Kudos

Hi Nikhil,

One solution to your problem is what valrey suggested and other can be by setting the length property of the input field accordingly.

Regards

Sid

former_member189631
Active Contributor
0 Kudos

Hi Nikhil,

*Try to set the value to the "width" property of your Inputfield.

*You can have a context attribute with the type of int and bind this into

width property to set the width value during runtime also.

Regards,

Ramganesan K.

Former Member
0 Kudos

Nikhil,

In Local Dictionary of WD project create your own custom type that is based on string and has Max. Length = 100 restriction applied.

Change type of corresponding context attribute to this new custom type.

InputFields these are bound to aforementioned context attribute (with restricted type) will inherit max.length restriction automatically.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Nikhil,

I am not sure if you can do it during design time, as i dont see any property for inputfield which can restrict the input size to n characters.

You can do it programmatically in your code.

Get input value form context and check the lenght of the input value.