Results 1 to 4 of 4

Thread: Lockdown!

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Lockdown!

    ok.. is there an easy way to lock all items for input in a form?

    thanks Kris

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    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.

  3. #3

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390
    not working ne other ideas?

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    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
  •  



Click Here to Expand Forum to Full Width