Jump to content

HTML Form Max. Value


Drezard

Recommended Posts

Hello, Im making a HTML Form that i want the different fields to have a maximum and a minimum value. How do I do this:

 

<form action='' method='post'>

User name: <input type='text' name='user'>
Password: <input type='password' name='pass'>

<input type='submit' name='submit'>
</form>

 

Now I want the text box for the user field to be at least 150 letters so the text box is much larger.

 

What would be the code for it?

 

- Cheers, Daniel

Link to comment
Share on other sites

I don't believe you can set the minimum length of an input field - you can set maxlength for text boxes but little else - even then it can be circumvented easily.

 

This is a situation wher data validation should really be conducted in a server side script - possibly a bit of javascript to validate before submitting but even that can be hood winked or turned off so the server side validation is a must IMO.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.