cancel
Showing results for 
Search instead for 
Did you mean: 

how to set input field limit to 255

Former Member
0 Kudos

When I enter more than 255 characters in a field and save, the backend only saves the first 255 characters. How do I limit my input field to only accept 255 characters?

thanks

Anton Kruse

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anton,

Create a simple type of base tyep string.. In the simple type , specify the min and max length.

Change the value attribute datatype to this simpletype and map it to the input field.

Note : This does not affect the displayed UI length of the input field.

Regards

Bharathwaj

Former Member
0 Kudos

the user must not be able to type more than 255 characters.

Ie. the text edit must not allow more than 255 characters to be displayed when typing them in.

Former Member
0 Kudos

Hi,

Follow the procedure given by Bharathwaj ,

create a simple type with string as base type and specify max length to 255.

Change the value attribute datatype to this simpletype and bind it to the input field.

Once it is bound with the inputfield,you can enter only 255 chars in that input field.

More than that specified chars are not displayed in the input field.

You can specify smaller number to test the same.

Hope it helps

Regards,

Santhosh

Former Member
0 Kudos

thanks Santhosh

pls elaborate a bit more on creating a simple type. Is this in the context?

Former Member
0 Kudos

Hi Anton,

If you are talking about TextEdit then the display of that has to be controlled by the properties cols and rows.

And to restrict the input characters you can

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

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

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

4)now bind your text edit property value with your context.

Former Member
0 Kudos

I still don't know what you mean by 'create simple type'.

pls elaborate giving steps.

I also don't see a representation tab.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Anton,

For creating a simple type go to the dictionary in WD explorer.Over there in data types you get simple type and Structure option under the simple type you create it.

Regards

Amit

Former Member
0 Kudos

Thanks all for the very quick and helpful responses.

regards

Anton Kruse

Former Member
0 Kudos

Hi Anton,

I got your point.But I dont think that keyboard events are incorporated in WD 7.0.

So i am not sure if this is possible.

Regards

Amit

Former Member
0 Kudos

Hi Anton,

Here you require to create a simple type which has the built-in type String and you can also set the minimum and the maximum length under the definition type.

If you enter more than 255 characters after setting the same as the maximum length the WDF will throw an error message for the same and the action will not be called.Does this suffice your requirement.

Regards

Amit