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
https://forums.phpfreaks.com/topic/38381-html-form-max-value/
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
https://forums.phpfreaks.com/topic/38381-html-form-max-value/#findComment-184192
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.