表格到电子邮件 [英] Form to Email

查看:118
本文介绍了表格到电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一些数据库记录,列在asp

页面的表格中。

该表位于< formtag内。

在每条记录(和表格行)的末尾,我创建了一个< select>

下拉框来显示。


用户为列表中的每条记录选择一个项目,然后点击提交。


以下代码用于创建电子邮件:


For Each in Request.Form

MailBody = MailBody& Request.Form(i)& vbcrlf

下一页


我需要的是第一个数据库字段打印在每个记录中的表格

和从下拉菜单中选择的项目

记录





产品A是

产品B否

产品C是


我尝试添加隐藏的输入类型来携带产品代码但是

以下是我的电子邮件正文:


选择状态,选择状态,选择状态,已批准,选择状态,

选择状态,选择状态,已批准,选择状态,选择状态,

批准,选择状态,选择状态

070512001R,069435001Q,069424001Q,069321001Q,069305001Q,069270001Q,

069167001Q,068744001Q,068677001Q,068677001Q,068466001Q,066497001Q,

061097001Q

提交


其中''选择状态' '是下拉列表中显示的默认文本。

它首先经历了所有下拉结果,并且它们通过所有产品代码,并且出于某种原因,vbcrlf无效?怎么

可以一起打印出来吗?


我需要身体展示


070512001R =已批准

069435001Q =已批准





请您帮助我做这件事,谢谢
< br $> b $ b谢谢


大卫

解决方案

你能发帖吗?你的表格的HTML部分,或者只是几行的样本

至少来自桌子?


Ray at work

" David" < da ********* @ scene-double.co.ukwrote in message

news:11 ***************** **** @ i3g2000cwc.googlegrou ps.com ...





我有一些数据库记录列在asp

页面的表格中。

该表格位于< formtag。

每条记录的末尾(和表格行),我创建了一个< select>

下拉框来显示。


用户为列表中的每条记录选择一个项目然后命中提交。


以下代码用于创建电子邮件的正文:


For Request.Form中的每个i

MailBody = MailBody& Request.Form(i)& vbcrlf

下一页


我需要的是第一个打印在表格上的数据库字段

每条记录和



" David" < da ********* @ scene-double.co.ukwrote in message

news:11 ***************** **** @ i3g2000cwc.googlegrou ps.com ...





我有一些数据库记录列在asp

页面的表格中。

该表格位于< formtag。

每条记录的末尾(和表格行),我创建了一个< select>

下拉框来显示。


用户为列表中的每条记录选择一个项目然后命中提交。


以下代码用于创建电子邮件的正文:


For Request.Form中的每个i

MailBody = MailBody& Request.Form(i)& vbcrlf

下一页


我需要的是第一个数据库字段打印在每个记录中的表格

和从下拉菜单中选择的项目

记录





产品A是

产品B否

产品C是


我尝试添加隐藏的输入类型来携带产品代码但是

以下是我的电子邮件正文:


选择状态,选择状态,选择状态,已批准,选择状态,

选择状态,选择状态,已批准,选择状态,选择状态,

批准,选择状态,选择状态

070512001R,069435001Q,069424001Q,069321001Q,069305001Q,069270001Q,

069167001Q,068744001Q,068677001Q,068677001Q,068466001Q,066497001Q,

061097001Q

提交


其中''选择状态' '是下拉列表中显示的默认文本。

它首先经历了所有下拉结果,并且它们通过所有产品代码,并且出于某种原因,vbcrlf无效?怎么

可以一起打印出来吗?


我需要身体展示


070512001R =已批准

069435001Q =已批准



基本HTML。您需要为每个选择的

列表提供不同的名称,以便可以唯一标识它们。如果您在下拉列表中有默认的

文本,请确保其值设置为空字符串,例如

< option value ="">选择状态< /选项取代。如果你没有为一个选项提供一个值

属性,它会选择任何选项。如果您为所有选择列表提供相同的名称,它们将以逗号分隔的字符串传递给

逗号分隔(这使得解析结果更加困难)。 />

-

Mike Brind


Ray,


这是在我的asp

页面中打印循环内记录的行:


response.write"< td align = center> < A

HREF = BBUSA_Repair_Lab_Datacheck.asp?SDLink =" &安培; RS(ReportID)& ">" &

ref& "< / a>< / td>< td>& nbsp;& nbsp;& nbsp;< / td>< td align = center>" &安培; part&

"< / td>< td>& nbsp;& nbsp;& nbsp;< / td>< td align = center>" &安培; serial&

"< / td>< td>& nbsp;& nbsp;& nbsp;< / td>< td align = left>" &安培;原因&

"< / B>< / td>< td align = LEFT>" &安培;钱和钱"< / B>< / TD>< TD>" &安培; FD&

"< / TD>< input TYPE = hidden name = PO VALUE =" &安培;参考文献">< / tr>"


变量''ref'',''part'',''serial'',''cause'',' 'money''可能是文本

字符串或数据库记录。


< select tagagainst每条记录在页面顶部定义

并设置为一个名为FD的变量,它位于

代码上面的底线


< TD>" &安培; FD& "< / TD>


FD ="< select name = select>< option> Approved< / option>< option> Not

已批准< /选项><选项>在您的位置报废< /选项><选项

选择>选择状态< /选项>< / select>"


我不能单独命名每个选择标签,因为只有1,并且

asp为循环中的每个记录重复它。


如果你能建议一个更好的方法来解决这个问题,我的耳朵和

非常感谢你的建议和帮助,非常感谢。


Hi,

I have some database records which are listed out in a table on an asp
page.
The table is within a <formtag.
At the end of each record (and table row), I have created a <select>
dropdown box to appear.

The user selects an item for each record in the list, then hits submit.

The following code is used to create the body of the email:

For Each i in Request.Form
MailBody = MailBody & Request.Form(i) & vbcrlf
Next

What I need in the body is the first database field printed on the form
in each record and the selected item from the dropdown against that
record

i.e.

Product A Yes
Product B No
Product C Yes

I have tried adding a hidden input type to carry the Product Code but
all I get is the following as my email body:

Select Status, Select Status, Select Status, Approved, Select Status,
Select Status, Select Status, Approved, Select Status, Select Status,
Approved, Select Status, Select Status
070512001R, 069435001Q, 069424001Q, 069321001Q, 069305001Q, 069270001Q,
069167001Q, 068744001Q, 068677001Q, 068677001Q, 068466001Q, 066497001Q,
061097001Q
Submit

Where ''Select Status'' is the default text to show in the dropdown.

It first goes through all the dropdown results, and them through all
the product codes and for some reason, the vbcrlf is not working ? How
can I print them together in sets ?

I need the body to show

070512001R = Approved
069435001Q = Approved

etc

PLEASE CAN YOU HELP ME DO THIS, THANKS

Thanks

David

解决方案

Can you post the HTML portion of your form, or just a sampling of a few rows
from the table at least?

Ray at work

"David" <da*********@scene-double.co.ukwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...

Hi,

I have some database records which are listed out in a table on an asp
page.
The table is within a <formtag.
At the end of each record (and table row), I have created a <select>
dropdown box to appear.

The user selects an item for each record in the list, then hits submit.

The following code is used to create the body of the email:

For Each i in Request.Form
MailBody = MailBody & Request.Form(i) & vbcrlf
Next

What I need in the body is the first database field printed on the form
in each record and



"David" <da*********@scene-double.co.ukwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...

Hi,

I have some database records which are listed out in a table on an asp
page.
The table is within a <formtag.
At the end of each record (and table row), I have created a <select>
dropdown box to appear.

The user selects an item for each record in the list, then hits submit.

The following code is used to create the body of the email:

For Each i in Request.Form
MailBody = MailBody & Request.Form(i) & vbcrlf
Next

What I need in the body is the first database field printed on the form
in each record and the selected item from the dropdown against that
record

i.e.

Product A Yes
Product B No
Product C Yes

I have tried adding a hidden input type to carry the Product Code but
all I get is the following as my email body:

Select Status, Select Status, Select Status, Approved, Select Status,
Select Status, Select Status, Approved, Select Status, Select Status,
Approved, Select Status, Select Status
070512001R, 069435001Q, 069424001Q, 069321001Q, 069305001Q, 069270001Q,
069167001Q, 068744001Q, 068677001Q, 068677001Q, 068466001Q, 066497001Q,
061097001Q
Submit

Where ''Select Status'' is the default text to show in the dropdown.

It first goes through all the dropdown results, and them through all
the product codes and for some reason, the vbcrlf is not working ? How
can I print them together in sets ?

I need the body to show

070512001R = Approved
069435001Q = Approved

Basic HTML. You need to provide different names to each of your select
lists so that they can be identified uniquely. Where you have a default
text in the drop down, make sure its value is set to an empty string eg
<option value="">Select Status</option>. If you don''t provide a value
attribute for an option, it picks up on whatever the option is. If you
provide the same name to all your select lists, they will be passed in a
comma-delimited string (which makes parsing the results more difficult).

--
Mike Brind


Ray,

Here is the line which prints out the records within a loop in my asp
page:

response.write "<td align=center><A
HREF=BBUSA_Repair_Lab_Datacheck.asp?SDLink=" & RS("ReportID") & ">" &
ref & "</a></td><td>&nbsp;&nbsp;&nbsp;</td><td align=center>" & part &
"</td><td>&nbsp;&nbsp;&nbsp;</td><td align=center>" & serial &
"</td><td>&nbsp;&nbsp;&nbsp;</td><td align=left>" & cause &
"</B></td><td align=LEFT>" & money & "</B></td><TD>" & FD &
"</TD><input TYPE=hidden name=PO VALUE=" & ref & "></tr>"

The variables ''ref'', ''part'', ''serial'', ''cause'', ''money'' might be text
strings or database records.

The <select tagagainst each record is defined in the top of the page
and set to a variable called FD, which is on the bottom line of the
code above

<TD>" & FD & "</TD>

FD = "<select name=select><option>Approved</option><option>Not
Approved</option><option>Scrap at your location</option><option
selected>Select Status</option></select>"

I cannot name each select tag seperately as there is only 1, and the
asp repeats it for each record in the loop.

If you can suggest a better way to go about this i''m all ears and
really appreciate your advise and help, thanks so much.


这篇关于表格到电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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