|
-
Apr 1st, 2004, 04:22 PM
#1
Lockdown!
ok.. is there an easy way to lock all items for input in a form?
thanks Kris
-
Apr 1st, 2004, 04:42 PM
#2
Frenzied Member
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function lockdown() {
for (i=0; i<document.getElementById('myForm').length; i++)
{
document.getElementById('myForm')[i].disabled = "disabled"
}
}
function lockup() {
for (i=0; i<document.getElementById('myForm').length; i++)
{
document.getElementById('myForm')[i].disabled = ""
}
}
</script>
</head>
<form id="myForm">
name: <input type="text" value="name"><br />
email: <input type="text" value="email"><br />
age: <input type="text" value="age"><br />
password: <input type="password"><br />
<input type="button" value="button"><br />
<input type="submit"><br />
</form>
<input type="button" value="lockdown" onClick="lockdown()"><br />
<input type="button" value="lockup" onClick="lockup()">
<body>
</body>
</html>
There is surely a better way to only lock input tags, but it's late, I'm tired.
Have I helped you? Please Rate my posts. 
-
Apr 1st, 2004, 05:34 PM
#3
not working ne other ideas?
-
Apr 7th, 2004, 08:39 AM
#4
Frenzied Member
sorry about the amazingly long time to reply, didn't notice you still needed help. or do you? it worked for me.
Have I helped you? Please Rate my posts. 
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
|