将表行作为唯一记录插入表单中 [英] Inserting table rows as unique records in a form

查看:73
本文介绍了将表行作为唯一记录插入表单中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,


我有一个ASP页面,其中5x5表格嵌入在插入记录表格中。此表包含多个字段(主要是下拉列表菜单),用于公司计时(用户通过从列表菜单中进行选择来记录他们的每日时间)。


我的挑战是如何计算了解用户如何完成表的所有行并单击一个按钮以提交整个表单并将每行插入作为唯一记录。换句话说,第1行中的所有字段都作为记录1插入到表中,第2行作为记录2插入,依此类推。


行中的所有字段都是唯一命名的(例如,行1中的每个列表/菜单在其末尾以... 01命名,对于其他行以此类推)。我可以轻松地将表格第1行提交到表格中作为记录1,但还没有想出如何将整个表格作为五个独特的记录提交。


其他比我使用ColdFusion来编写这个功能,但这超出了我的知识基础。他们使用迷你提交和迷你提交。在进行列表/菜单选择时使用onchange事件提交表单(从而刷新后续列表/菜单中的值),但我无法在ASP中复制它。


我可以发布我迄今为止任何人都想看到它的代码,但我想先提出问题,看看是否有人有任何建议或网址链接/示例指向我。

JM

Greetings,

I have an ASP page with a 5x5 table embedded inside an Insert Record Form. This table contains several fields (mostly drop down list menus) and is used for corporate timekeeping (users record their daily hours by making selections from the list menus).

My challenge is to figure out how the user can complete all rows of the table and click one button to submit the entire form AND have each row inserted as a unique record. In other words, all fields in row 1 are inserted into the table as record 1, row 2 is inserted as record 2, and so on.

All fields within a row are uniquely named (e.g., every list/menu in row 1 is named with "..01" at its end, and so on for other rows). I can easily make the table submit row 1 into the table as record 1, but haven''t figured out how to submit the entire table as five unique records.

Others more advanced than me have used ColdFusion to code this functionality but that''s beyond my knowledge base. They use "mini-submits" utilizing the onchange event to submit the form when a list/menu selection is made (thereby refreshing the values in subsequent list/menus), but I haven''t been able to replicate this in ASP.

I can post code for what I have thus far should anyone want to see it, but thought I''d pose the question first to see if anyone has any advice or URL links/examples to point me toward.

Regards,

JM

推荐答案

JM,


如果将数据库插入代码放入函数中,则可以为每行数据调用一次。您甚至可以创建一个循环,将行号附加到控件名称的末尾,然后将请求值传递给函数。这是我的意思的一个简单示例:

JM,

If you put your database insert code into a function then you can call it once for each row of data. You could even create a loop which appends the row number to the end of the control name which then passes the request value to the function. Here''s a quick example of what I mean:

展开 | 选择 | Wrap | 行号


在概念上有意义,但是理解它我需要构建代码,看看它是如何工作的。我会在接下来的一周内处理它并发布任何问题或问题。


谢谢,B博士


JM
It makes sense in concept, but to understand it better I need to build out the code and see how it works. I''ll work on it in the coming week and post any questions or problems should I have them.

Thanks, Dr B.

JM


好吧,我已经尝试过编码并遇到了问题。


首先,这里是代码(注意我在3x3表上测试这个:)

Well, I''ve tried coding this and have run into a problem.

First, here''s the code (Note I''m testing this on a 3x3 table):

展开 | 选择 | Wrap | 行号


这篇关于将表行作为唯一记录插入表单中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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