AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem removing readonly in IE

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java.javascript
View previous topic :: View next topic  
Author Message
J. McConnell
Guest





PostPosted: Fri Dec 01, 2006 1:44 am    Post subject: Problem removing readonly in IE Reply with quote



I am having trouble with the following code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test</title>
</head>
<body>
<input value='test' type='text' readonly='readonly'
onfocus='this.readOnly = false;'
onblur='this.readOnly = true;'></input>
</body>
</html>

In FF, this works as I would expect. When clicking on the input, the
readOnly property is set to false and the focus is given to the element,
with the cursor placed after the last character.

In IE, the readOnly property is set to false, but the element isn't
actually given focus. Instead, I have to click on the input a second
time in order to actually input text with the keyboard.

Is there a way to make this work the same in IE as it does in FF? I
have tried things like calling this.focus() and this.click() after
setting readOnly to false, but they have no effect.

Any help would be greatly appreciated.

Thank you,

- J.
Back to top
David Griffiths
Guest





PostPosted: Thu Nov 08, 2007 1:27 am    Post subject: Re: Problem removing readonly in IE Reply with quote



Hi J

According to my book (JavaScript - the definitive guide.

In Netscape 4 event model , the onfocus handler function is passed an Event
object as an argument.

In the IE event model, no argument is passed, but the application Event
object is available as the event property of the Window Object that contains
the element.

HTH

Dave

"J. McConnell" <j-dot@j-dotonline.com> wrote in message
news:slrnemucv4.b64.j-dot (AT) kant (DOT) overstock.com...
Quote:
I am having trouble with the following code:

?xml version="1.0" encoding="UTF-8"?
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
head
title>Test</title
/head
body
input value='test' type='text' readonly='readonly'
onfocus='this.readOnly = false;'
onblur='this.readOnly = true;'></input
/body
/html

In FF, this works as I would expect. When clicking on the input, the
readOnly property is set to false and the focus is given to the element,
with the cursor placed after the last character.

In IE, the readOnly property is set to false, but the element isn't
actually given focus. Instead, I have to click on the input a second
time in order to actually input text with the keyboard.

Is there a way to make this work the same in IE as it does in FF? I
have tried things like calling this.focus() and this.click() after
setting readOnly to false, but they have no effect.

Any help would be greatly appreciated.

Thank you,

- J.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java.javascript All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.