动态添加表格行到输入的最后一行条目(复杂行) [英] Add table row on the fly to last row entry on input (complex rows)

查看:73
本文介绍了动态添加表格行到输入的最后一行条目(复杂行)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我主要是PHP开发人员,但已经开始涉足jquery和ajax。


我创建了一个表格各种列(例如复选框,下拉菜单,文本输入等)下拉菜单基于php / mysql并从数据库中调用。


默认情况下我已实现了for( $ i = 0; $ i< 10; ++ $ i)在表格中创建10行的程序,每行都有自己的tr id ="?"。


现在我所追求的是创建一种机制,如果用户在最后一行(tr id =" 10"),并输入一个员工的名字,id或任何动态创建动态的另一行,并继续这样做,直到用户输入完数据。有了这个我可以成像,我需要一个基于最后一行输入的onchange效果。


我很困惑的部分是如何基于我的所有列创建一个新行,一些选择,使用mysqli从数据库中调用checboxes等。


任何帮助或示例代码都将不胜感激!


提前致谢


Chris

Hi

I am mainly a PHP developer but have started to dabble with jquery and ajax.

I have created a table with various columns (e.g checkboxes, drop down menus, text inputs, etc) The drop down menus are php/mysql based and called from the database.

By default i have implemented a for($i = 0;$i < 10;++$i) procedure to created 10 rows within the table each with their own tr id="?".

Now what i am after is to create a mechanism where if a user is on the last row (tr id="10") and say enters an employee''s name, id, or whatever to create dynamically another row on the fly, and keep doing so until the user has finished inputting data. With this i can image i would need an onchange effect based on last row entry.

The part i am puzzled with is how to create a new row based on all my columns, some selects, checboxes, etc being called from the database using mysqli.

Any help or example code would be greatly appreciated!

Thanks in advance

Chris

推荐答案

i = 0;


i< 10; ++
i < 10;++


i)在表格中创建10行的程序,每行有自己的tr id ="?" ;.


现在我要做的是创建一种机制,如果用户在最后一行(tr id =" 10")并输入一个员工的名字,id或其他任何动态创建另一行的机制,并继续这样做,直到用户输入完数据。有了这个我可以成像,我需要一个基于最后一行输入的onchange效果。


我很困惑的部分是如何基于我的所有列创建一个新行,一些选择,使用mysqli从数据库中调用checboxes等。


任何帮助或示例代码都将不胜感激!


提前致谢


Chris
i) procedure to created 10 rows within the table each with their own tr id="?".

Now what i am after is to create a mechanism where if a user is on the last row (tr id="10") and say enters an employee''s name, id, or whatever to create dynamically another row on the fly, and keep doing so until the user has finished inputting data. With this i can image i would need an onchange effect based on last row entry.

The part i am puzzled with is how to create a new row based on all my columns, some selects, checboxes, etc being called from the database using mysqli.

Any help or example code would be greatly appreciated!

Thanks in advance

Chris


这篇关于动态添加表格行到输入的最后一行条目(复杂行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆