Multiple Forms With Input Fields With The Same Name Attribute? Good Or Bad?

前端 未结 3 966
再見小時候
再見小時候 2020-12-16 11:23

Is it an acceptable practice to have multiple HTML forms on a page with input fields that share the same name attribute? For example, the page contains a listing of all play

3条回答
  •  自闭症患者
    2020-12-16 11:57

    Agree with above answer. Name is totally ok, and will be passed as response parameter of your form. Different story would be if your input elements would have same id's as well - some browsers might have problems traversing dom of your document.

    Again, think of bunch of radio buttons, where users can select gender etc. They must have same name (but different id's)...

提交回复
热议问题