Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Limit Text field length

New Here ,
May 17, 2006 May 17, 2006
Hi All
I have a field of type CHAR length=9. It should hold 9 digit for ID number. In Dreamweaver MX insert form, how can I do form validation to check that the user enter 9 digits (excatly 9 digits other wise a message should appear telling him to enter 9 digits)

I'm using PHP My SQL and Dreamweaver MX

Thanks
TOPICS
Server side applications
307
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 17, 2006 May 17, 2006
In the form itself, you can specify the maximum number of characters that can benetered in the field. Select the field in Design view and set Max Chars to 9. (n code view, set the maxlength attribute to 9.)

To verify that the user entered all 9 characters, create a javascript function that runs on the onChange event. The javascript should check for a field length of 9, and alert the user if less than that. I believe you can check the length of the field contents using document.form1.field1.value.length(), where form1 is the name of your form and field1 is the name of your text field.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 19, 2006 May 19, 2006
LATEST
Does any one knows a useful online tutorial that explain that?

Thanks
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines