Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

name属性名字相同就会不再创建hidden属性的input吗? #59

Open
qidizi opened this issue Jul 10, 2014 · 4 comments
Open

name属性名字相同就会不再创建hidden属性的input吗? #59

qidizi opened this issue Jul 10, 2014 · 4 comments

Comments

@qidizi
Copy link

qidizi commented Jul 10, 2014

考虑像php的name = 'inputs[]'的情况,虽然可以自己使用name='inputs[0]',name='inputs[1]'这样,但是感觉没有必要

@qidizi
Copy link
Author

qidizi commented Jul 10, 2014

像3级地区这样的select就得很麻烦去考虑这个index的问题.

@qidizi
Copy link
Author

qidizi commented Jul 11, 2014

今天再看还是觉得应该算是一个bug,
一个页面a form 加一个select,b form也加相同的select,
但是发现因为name相同,它却只创建一个input,而select实例是有二个.
按道理,form不同,name是可以相同的.

@popomore
Copy link
Member

建议就用一个 name,不然会增加复杂度。

你的场景如果两个 form 是同一个场景可以和成一个 form,如果不同建议用两个 name。

@qidizi
Copy link
Author

qidizi commented Jul 11, 2014

呵,我觉得这个有点不好呢,
首先,很少有人一定意识到不同的form一定要使用不全页不同的name,这有点强求了.
2,在实现上,获取input是不需要使用input.name这么简单的全页获取呀,
另一个问题就是就导致使用的人一定要小心的防止一个页面中弄出相同的name来,
都是很大的问题存在的.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants