|
-
Nov 13th, 2006, 04:50 PM
#1
Thread Starter
Frenzied Member
cant seem to get txt field to disable
i have this at the top of my php file
Code:
<script language="JavaScript">
document.form1.txt_Username.disable = true;
</script>
doesnt disable the field though. any ideas why?
-
Nov 14th, 2006, 03:54 AM
#2
Re: cant seem to get txt field to disable
At the time this code is executed, the form and the text field in question probably don't exist yet. You should do this onload. And you should do it in an external JS file, of course.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 14th, 2006, 04:08 AM
#3
Re: cant seem to get txt field to disable
Shouldn't that be disabled or is that just a typo?
-
Feb 1st, 2007, 03:55 AM
#4
Hyperactive Member
Re: cant seem to get txt field to disable
why don't you use this:
Code:
<input readonly="true" type="text" name="textfield" />
It's a locked textfield.
-
Feb 2nd, 2007, 09:03 AM
#5
Member
Re: cant seem to get txt field to disable
<script language="JavaScript">
function disabletxtOnload(){
document.form1.txt_Username.disable = true;
}
</script>
<body onload="disabletxtOnload()">
hope this help!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|