Skip to Content
avatar image
Former Member

restrict input field size

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

Nikhil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Apr 12, 2007 at 10:17 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 12, 2007 at 10:21 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 12, 2007 at 10:45 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 12, 2007 at 11:17 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 16, 2007 at 01:03 PM

    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

    Add comment
    10|10000 characters needed characters exceeded