...

View Full Version : Enable All Fields



Yorick
04-14-2005, 03:27 PM
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!

snowieken
04-14-2005, 03:49 PM
I'm feeling benevolent today. Here you go.

Link code:
<a href="javascript:enableAll();">Enable all fields</a>Script to put in your head tag:
<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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum