hi,
how can i make a text field 'readonly' without disabling it. I am using the same form and text fields some time as readonly and some
time as read and write.my problem is i want to use the same textfields for 'edit' purpose and for 'search' purpose.
while user press the 'search' button the textfields should be in readonly mode without disabling them. I am using the folowing code
which is working partially.
I am using two events on each text field, one is 'onkeypress' and other one is 'onmousedown'.
my code for onkeypress is as follows
function abc()
{
event.keyCode=0;
}
but for the above function is working only for character keys such as 'a to z' and '0-9'keys but this function is not working for
'tab' key 'delete' key and other keys, so the user can easily delete the context of textfield.
hence plz suggest any other alternate for this problem so that the user can not delete the contents of textfields through mouse and
keyboard, i want all the textfields in enabled mode only.
thanks in advance
javascript digest <javascript@p...> wrote:-----------------------------------------------
When replying to the digest, please quote only
relevant material, and edit the subject line to
reflect the message you are replying to.
-----------------------------------------------
The URL for this list is:
http://p2p.wrox.com/list.asp?list=javascript
JAVASCRIPT Digest for Saturday, March 08, 2003.
1. Window open in Netscape 6
2. Re: Window open in Netscape 6
----------------------------------------------------------------------
Subject: Window open in Netscape 6
From: "Udhayakumar. U"
Date: Sat, 8 Mar 2003 12:53:27 +0530
X-Message-Number: 1
Hi,
I am not able to open a window in Netscape 6.0
I am using the following code
var txt = '\n' +
'\n' +
'\n'
+
'\n' +
'\n' +
'\n' +
'\n' +
'\n'
var Height = screen.height;
var windowName = "HistoryDetails" + intCounter
if(Height > 720)
{
newWindow[intCounter] = window.open
('',windowName, "width=1012,height=708,left=0,top=0");
}
else
{
newWindow[intCounter] = window.open('',windowName,
"width=788,height=522,left=0,top=0");
}
newWindow[intCounter].opener = self
var newDocument = newWindow[intCounter].document
newDocument.write(txt)
newDocument.close()
On bodu load of this form i am calling the following function
function SendForm()
{
newWindow[intCounter].document.PRCHisfrm.qString.value = intCounter
newWindow[intCounter].document.PRCHisfrm.submit()
}
In IE and Netscape 4.7x it is working well
But in NS 6. it is not working
Please help me to solve this
Regards
Udhaya
----------------------------------------------------------------------
Subject: Re: Window open in Netscape 6
From: "Wojciech Pirog"
Date: Sat, 8 Mar 2003 13:44:53
X-Message-Number: 2
ok, i didn't look thru your entire code... but here's the deal -
window.open has a following syntax:
window.open(url,windowname,features)
url is the address of the web page you want to open,
windowname is a name of your window,
and features contains elements that describe how your window is going to
be opened...
so say you have a function named pop()
function pop(url,name,features) {
window.open(url,name,features); }
now if you want to use that function within your HTML page do this:
<.... onClick="pop
('yourpagename.html','mywin','height=200,width=400,fullscreen')" .... >
that should do it....
voytech
---
END OF DIGEST
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more