Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Enable All Fields

    I need a javascript, I want, when i click on 1 link, that al the disabled fields in my form will be enabled.

    Field names:
    ftp
    ip
    port
    username
    password
    path

    I have a the fields maked disabled by doing like this:
    <input id="ftp" name="ftp" type="text" value="" size="88" disabled>

    Thanks in advance!

  • #2
    Regular Coder
    Join Date
    Nov 2004
    Location
    The land of chocolate
    Posts
    226
    Thanks
    1
    Thanked 16 Times in 16 Posts
    I'm feeling benevolent today. Here you go.

    Link code:
    Code:
    <a href="javascript:enableAll();">Enable all fields</a>
    Script to put in your head tag:
    Code:
    <script language="JavaScript" type="text/javascript">
    <!--
    function enableAll() {
    	with(document.form1) {      // form1 is the name of the form in this example
    			for (i=0;i<elements.length;i++) {
    				elements[i].disabled=false;
    			}
    	}
    }
    //-->
    </script>
    -Snow

    Susie, if you want to see your doll again, leave $100 in this envelope by the tree out front. Do NOT call the police. You CANNOT trace us. You CANNOT find us.

    Sincerely,
    - Calvin.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •