wrote:
> Hi!
>
> When accessing my web page I build up the javascript and html
> dynamically. Depending on an parameter I want to set all the fields
> (input tags) readonly. How do I do this? Of course I can write if
> statements to add different input tags with and without the readonly
> attribute. But is it possible to write a javascript that onload search
> the page and add readonly to all input tags?
>
> Regards /Ulrika
function denyReadingPrivilegesToTextInputs(form){
var f=form.length;
while(f--){
if(form.elements[f].type=="text"){
form.elements[f].readOnly=true;
}
}
}
Note "readOnly" property, it's case sensative.
Mick