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 June 5th, 2009, 03:19 AM
Bedlore Bedlore is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 Bedlore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 26 sec
Reputation Power: 0
Help with IE6/7 problem

Hi Everyone!

I use the following code which prevents users from entering quotes or apostrophes in real time and it works extremely well in Firefox but is less forgiving in IE6 and IE7. The problem with IE is that while is does prevent " & ' it does no allow a user to go back and edit their text the back arrow is prevented from working and the cursor always gets forced to the end of the input strong.

Please help me to get the code working in IE, its a nice piece of code other than this.

Code:
<script type="text/javascript" language="javascript">
<!--
function stripQuotes(obj){
    var string = obj.value;
    if (string.substring(0,1) == '"' || string.substring(0,1) == "'")
        string = string.substring(1,string.length);
    if (string.substring(string.length,string.length-1) == '"' || string.substring(string.length,string.length-1) == "'")
        {
    alert("Please do not use single or double quotation marks in your responses as this can cause difficulties processing the data...");
    string = string.substring(string.length-1,0);
}
obj.value = string;
}
-->
</script>


And the HTML call element.
Code:
<input onkeydown="stripQuotes(this);" type="text" name="input_name" value="" />


Thank you.

Reply With Quote
  #2  
Old June 5th, 2009, 04:08 AM
phoenix1986's Avatar
phoenix1986 phoenix1986 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Location: India
Posts: 316 phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 41 m 46 sec
Reputation Power: 75
Send a message via Yahoo to phoenix1986
Red face

Hi !!
i tried it out with IE 6
it works perfectly fine....
__________________
“Life may not be the party we hoped for, but while we are here we should sing, dance and be merry all the time......."

Reply With Quote
  #3  
Old June 5th, 2009, 04:56 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,880 Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)  Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 2 Days 8 h 47 m 8 sec
Reputation Power: 967
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
You should really be using the onkeyup event rather than onkeydown.
__________________
Don't like me? Click it.

Scripting problems? Windows questions? Ask the Windows Guru!

Stay up to date with all of my latest content. Follow me on Twitter!

Help us help you! Post your exact error message with these easy tips!

Reply With Quote
  #4  
Old June 5th, 2009, 05:03 AM
Bedlore Bedlore is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 Bedlore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 26 sec
Reputation Power: 0
I did actually try onkeyup as well. It's actually worse, it suffers from all the same problems described in my first post but in addition it is possible to input an apostrophe simply by typing another character after an apostrophe quickly.

Reply With Quote
  #5  
Old June 5th, 2009, 05:24 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,880 Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)  Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 2 Days 8 h 47 m 8 sec
Reputation Power: 967
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
I personally do not like active validation after each character entry. I would make use of the onBlur event and simply strip out any unwanted characters when the selection moves to a different field.

Reply With Quote
  #6  
Old June 5th, 2009, 07:05 AM
Bedlore Bedlore is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 Bedlore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 26 sec
Reputation Power: 0
Yes you might have a point there. I guess I did it to partially educate the users as well.

Can you point me to any scripts that do this elegantly and a cross browser friendly?

Reply With Quote
  #7  
Old June 25th, 2009, 12:51 AM
Bedlore Bedlore is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 4 Bedlore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 26 sec
Reputation Power: 0
*BUMP*

Still desperate for a solution to this one, can anyone help?

Reply With Quote
  #8  
Old June 25th, 2009, 04:20 AM
phoenix1986's Avatar
phoenix1986 phoenix1986 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Location: India
Posts: 316 phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 41 m 46 sec
Reputation Power: 75
Send a message via Yahoo to phoenix1986
i had written a function which removes consecutive "/" and those at the end and the begining ...
if you want i can post that for u...

may be you can alter it...

Reply With Quote
  #9  
Old June 25th, 2009, 07:39 AM
phoenix1986's Avatar
phoenix1986 phoenix1986 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Location: India
Posts: 316 phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level)phoenix1986 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 41 m 46 sec
Reputation Power: 75
Send a message via Yahoo to phoenix1986
you can see here

maybe it'll help...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Help with IE6/7 problem


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





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek