HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 23rd, 2004, 03:02 PM
curiousidiot curiousidiot is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 curiousidiot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Need Help!

Well I am just stuck in kind of piculiar problem.
I hope some one could help with it.

I have a text field where user can put certain number of character (10). If any user exceeds that number then the input will not be taken.

The problem is when a user paste some text which is over 10 character then i cannot pop an error message right away.
Is there any way that as soon as user paste characters more than 10 by right clicking the mouse and then select paste, an error message can be provided?

Reply With Quote
  #2  
Old July 27th, 2004, 12:07 PM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 183 icepricessa User rank is Private First Class (20 - 50 Reputation Level)icepricessa User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 16 h 57 m 22 sec
Reputation Power: 6
hmm.. maybe some kind of javascript function code help?

haha not too sure though all the best anyways

Reply With Quote
  #3  
Old July 27th, 2004, 09:01 PM
Hawknz's Avatar
Hawknz Hawknz is offline
Blonde Contributor
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: New Zealand
Posts: 98 Hawknz User rank is Sergeant (500 - 2000 Reputation Level)Hawknz User rank is Sergeant (500 - 2000 Reputation Level)Hawknz User rank is Sergeant (500 - 2000 Reputation Level)Hawknz User rank is Sergeant (500 - 2000 Reputation Level)Hawknz User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 21 h 59 m 57 sec
Reputation Power: 13
I take it you are trapping each keypress using the onKeyDown= function?

Which 'Text Field' type are you using? <input type=text...> or <textarea...>?

I suggest you try using the onChange function. Here's an example for both types.

<textarea ... onChange="if (this.value.length > 10) {alert('You idiot, no more than 10 characters!'); this.value=''; this.focus();}" ...></textarea>

and

<input type=text maxlength="10" ...>

Hope that helps.
__________________
Hawk - The flightless Kiwi bird

Did I help you out? Click the and agree.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Need Help!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway