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

前端 未结 3 971
再見小時候
再見小時候 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:43

    yes that's perfectly fine.. in fact i personally feel that its really a good practice to do so as it turns relatively pretty handy for developers to work with relatively less names as compared to bunch of them.. moreover when elements are on different forms it dose not cause name space collision in any way since to identify elements in js by name we use both form name as well as input field name so it dose not cause any issues...

提交回复
热议问题