How do i limit the charlength for a input field?
How do i limit the charlength for a input field?
Hi,
i'm totally new here with datatables. I installed the tutorials and my first question is:
"How do i limit the charlength for a datafield (varchar(x)). Is it possible to do it with the editor?
If i enter a longer charsequence, the editor show's me the complete inserted sequence. But inside
the DB the sequence has been cropped.
How do i limit it? I thought the editor would do it automatically.
Thank you.
i'm totally new here with datatables. I installed the tutorials and my first question is:
"How do i limit the charlength for a datafield (varchar(x)). Is it possible to do it with the editor?
If i enter a longer charsequence, the editor show's me the complete inserted sequence. But inside
the DB the sequence has been cropped.
How do i limit it? I thought the editor would do it automatically.
Thank you.
This discussion has been closed.
Replies
[code]
new DTField( array(
"name" => "name",
"dbField" => "name",
"validator" => 'DTValidate::maxLen',
"opts" => array(
"maxLen" => 100
)
) )
[/code]
Editor will then automatically reject anything which is > 100 characters with an error message.
Regards,
Allan