Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 03:55 AM
Tony Brinton
Guest
 
Posts: n/a
Default How to limit form field input?

I'm a beginning PHP programmer. I'm wondering if there is an easy way to
limit a user's input in a text field to 1000 characters?

Thanks,

Tony




  #2  
Old July 17th, 2005, 03:55 AM
Pedro Graca
Guest
 
Posts: n/a
Default Re: How to limit form field input?

Tony Brinton wrote:[color=blue]
> I'm a beginning PHP programmer. I'm wondering if there is an easy way to
> limit a user's input in a text field to 1000 characters?[/color]

After the user sends his textfield (whatever the length) you can cut
that into the first 1000 characters:
$limited = substr($_POST['textfield'], 0, 1000);


If you want to limit at the client side, there's always the unreliable
option of using JavaScript.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
  #3  
Old July 17th, 2005, 03:55 AM
rostik
Guest
 
Posts: n/a
Default Re: How to limit form field input?

"Tony Brinton" <tony@morris-design.com> wrote in message
news:BC4522C7.818%tony@morris-design.com...[color=blue]
> I'm a beginning PHP programmer. I'm wondering if there is an easy way to
> limit a user's input in a text field to 1000 characters?[/color]

<input type="text" maxlength="10000">


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.