posted 22 years ago
What I would do is this method I have shown which I changed below with a form submit. This method is the way I perfer since I do not have to put a functions to every form element on the page. Again move the _ from on_click and on_load.
<script>
function LoadIt(how){
for(i=0;i<document.forms.length;i++){
for(j=0;j<document.forms[i].elements.length;j++){
document.forms[i].elements[j].disabled=how;
}
}
if(how){
document.FormName.ElementName.disabled=false; //Place element here to be enabled
document.FormName.FS.disabled=false;
}
else{document.FormName.submit();}
}
function StartIt(){LoadIt('true');}
window.on_load=StartIt
</script>
<input type="button" value="Submit" Name="FS" on_click="LoadIt('false')>
or if you really want too it can be done like this. It works well and does not give the disabled look to the elements, but you need to add a tag to every element.
<script>
var Dissed=true;
function WatchIt(XX){
if(Dissed)XX.blur();
}
</script>
<input type="text" name="T1" value="A1">
<input type="text" name="T2" value="A1" onfocus="WatchIt(this)">
<input type="text" name="T3" value="A1" onfocus="WatchIt(this)">
And if for some reason you want the form elements to be enabled, all you need to do is set Dissed=false;
Eric