jquery添加更多表单项
所以这是我的问题,我想要的是允许我们的销售人员在客户联系人中添加更多电话号码。
我们有一个看起来像这样的表格。 (请注意,我只显示我们联系区域的部分)
<form>
<div id="numbers">
<input id="no1" value="" class="phone" type="numbers"/>
</div>
</form>
所以基本上我想要的就是当他们完成一个电话号码时,它会在其下方添加一个新的输入框,并询问他们是否还想添加。
然后我需要找出存储它们的最佳方法,有什么建议吗?
我的想法是将它们结合在一起,如下所示
025555555,0311555445,044585522
So here is my question, what I am wanting is to allow our sales guys to add more phone numbers in a customers contact.
We have a a form which looks like this. (note I only showing the part from our contact area)
<form>
<div id="numbers">
<input id="no1" value="" class="phone" type="numbers"/>
</div>
</form>
so basically what I want is away that when they complete one phone number it adds a new input box below it and ask if any more they want to add.
I then need to work out the best way to store them, any suggestions?
My thinking was to join them together as the following
025555555,0311555445,044585522
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
示例:
Example:
试试这个演示 - http://jsfiddle.net/cAMAe/2/
只需将 id 更改为 class 。如果由于某种原因您无法删除 id,请在 if 块内执行以下操作
Try this demo - http://jsfiddle.net/cAMAe/2/
Just change id to class . If due to some reason you cannot remove the id do the folowing inside the if block
我的想法是这样的:
What I think, is like this: