enabling all fields on a form

J

jpw

I've got a script for enabling all fields on a form (below). However,
it doesn't work for FireFox (and probably Safari). Ideas to get it
working in FF?


<script language="JavaScript">
function disableAllSelectFields(){
var f = document.getElementsByTagName('select');
for(var i=0;i<f.length;i++){
f.setAttribute('disabled',false)
}
}
</script>


Thanks,


jpw
 
D

David Dorward

I've got a script for enabling all fields on a form (below). However,
it doesn't work for FireFox (and probably Safari). Ideas to get it
working in FF?
f.setAttribute('disabled',false)}


Avoid setAttribute, it is very broken in IE (which is why this code
seems to work there).

f.disabled = false;
 
J

jpw

I've got a script for enabling all fields on a form (below). However,
it doesn't work for FireFox (and probably Safari). Ideas to get it
working in FF?
f.setAttribute('disabled',false)}


Avoid setAttribute, it is very broken in IE (which is why this code
seems to work there).

f.disabled = false;


Many thanks, David!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top