简体   繁体   English

html表单无法找到属性名称的设置方法

[英]html form unable to find setter method for attribute name

I get error html form unable to find setter method for attribute name when I add name attribute in form action like 当我在表单操作中添加name属性时,出现错误的html form unable to find setter method for attribute name

<html:form action="updateBOEMedicalAccept" name="updateBOEMedicalAcceptForm">

I need name attribute to use it in javascript 我需要name属性才能在javascript中使用它

like 喜欢

document.updateBOEMedicalAcceptForm.BOE_NO.disabled = true;

and id attribute is also not working 并且id属性也不起作用

Please guide. 请指导。

For getting element by name, 为了通过名称获取元素,

document.getElementsByName('BOE_NO').disabled = true;

For getting element by id 通过id获取元素

document.getElementsById('idOfBOE_NO').disabled = true;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM