how to overcome “name” attribute error in xhtml Strict

我的梦境 提交于 2019-12-24 13:27:33

问题


in my form i have this code

<form action="mail.php" class="contactForm" name="cform" method="post">

Problem is when i validate it tells me "name" is not allowed on xhtml strict. is there a way i can use soem thing else for this.

thanks


回答1:


You should be using id as a unique identifier instead of name.

Is there a particular reason that you need to set the name though? You can just remove the name declaration unless there's a reason for it.




回答2:


Use ID.

<form action="mail.php" class="contactForm" id="cform" method="post">


来源:https://stackoverflow.com/questions/2369281/how-to-overcome-name-attribute-error-in-xhtml-strict

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!