Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-02-2011, 12:53 AM   PM User | #1
Microsuck
Regular Coder

 
Microsuck's Avatar
 
Join Date: Oct 2011
Location: 127.0.0.1
Posts: 123
Thanks: 44
Thanked 5 Times in 5 Posts
Microsuck is an unknown quantity at this point
Set Character Limit on Textarea

Hello.

I have a textarea and I need it to only allow a maximum of 1000 characters. How can I do that?

I am currently using JavaScript to do this, but anyone that knows how to disable JavaScript can bypass it.

And I used this PHP code, to try and stop it, but it still inserts the post into the database even though it redirects as well. I know this isn't the PHP forum, but I thought I'd add this, just so nobody asks.

PHP Code:
if (strlen($post) > 1000) {
header('Location: 1000chars.html');


Last edited by Microsuck; 11-02-2011 at 01:30 AM..
Microsuck is offline   Reply With Quote
Old 11-02-2011, 01:31 AM   PM User | #2
Microsuck
Regular Coder

 
Microsuck's Avatar
 
Join Date: Oct 2011
Location: 127.0.0.1
Posts: 123
Thanks: 44
Thanked 5 Times in 5 Posts
Microsuck is an unknown quantity at this point
My stupidity!

I placed that line of code after the SQL query. I guess I dun goofed.
Microsuck is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:14 PM.


Advertisement
Log in to turn off these ads.