如何根据用户请求动态创建相同的输入字段(单击“添加更多”按钮)?
在职位页面上,我希望有 3 组静态输入字段,以便用户可以分别输入职位名称、职位描述等。
我不确定最好的方法是什么,但我想底部会有一个按钮,上面写着“添加更多”。当用户点击它时,它会显示(比如 3)更多组的输入字段。并且在输入最多 6 个组后,用户仍然可以单击“添加更多”(也许可以在允许的范围内多次),以便每次单击时再添加 3 个组。
希望这足够清楚。我正在慢慢进入 AJAX 世界。
谢谢。
On the Job Positions page, I would like to have 3 groups of input fields which are static so user can enter Job Name, Job Description, etc. respectively.
I'm not sure what the best approach is but I imagine there would be a button at the bottom which says "Add More". When user clicks on this, it would reveal (say 3) more groups of the input fields. And after entering up to 6 groups, the user can still click "Add More" (perhaps as many times as permissible) to bring up 3 more each time it is clicked.
Hope this is clear enough. I'm slowly getting into the AJAX world.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用诸如 jQuery 之类的框架,并使用一个名为append 的特定函数,非常容易做到,你会发现框架在未来也会为你简化很多事情
I would recommend using a framework such as jQuery and use a particular function called append, very easy to do and you'll find the framework simplifying alot of thing for you in the future as well