drw results in one form field (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


Joey -> drw results in one form field (2/10/2008 20:31:28)

I'm trying to get all of my drw results into one form field, if i use a text field in the drw it makes different rows, i need all of the results in one field.

any suggestions?




rdouglass -> RE: drw results in one form field (2/10/2008 20:44:56)

You could set a variable. Then add all the DRW data to the variable. Then set the variable tot he field:

<%DIM myTextData
myTextData = ""%>

Then inside the DRW:

<%myTextData = myTextData & P_FieldVal(fp_rs,"Field1")
myTextData = myTextData & P_FieldVal(fp_rs,"Field2")
'etc, etc.
%>

Then your text field like so:

<textarea name="myText"><%=myTextData%></textarea>

Something like that maybe?




Joey -> RE: drw results in one form field (2/10/2008 23:03:20)

Thanks Roger

That is close, it is showing one email in the first row, two in the second, and 3 so on.

it adds text boxes and for each record it adds the rows above. i just need one row with all drw results in one text box.

i also need to insert a comma between email addresses.

can you help me with those 2 issues?

thanks

joey




rdouglass -> RE: drw results in one form field (2/11/2008 8:59:15)

Can you post the code you're using?




Joey -> RE: drw results in one form field (2/11/2008 10:42:54)

<%DIM myTextData 
myTextData = ""%> 

<head>
<meta http-equiv="Content-Language" content="en-us">
</head>

<table width="100%" border="1">
	<thead>
		<tr>
			<th ALIGN="LEFT"><b>EmailAddress</b></th>
		</tr>
	</thead>
	<tbody>
		<!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM recd_messages"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=1 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="test"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&EmailAddress=202&Message=202"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<%myTextData = myTextData & FP_FieldVal(fp_rs,"EmailAddress")%> 
<tr>
			<td>
			<form method="POST" action="test2.asp">
	<table border="1" width="100%">
		<tr>
			<td>Phone Number (s)</td>
			<td><textarea name="myText" rows="8" cols="39"><%=myTextData%></textarea></td>
		</tr>
		<tr>
			<td>Message:</td>
			<td><textarea rows="3" name="Message" cols="39"></textarea></td>
		</tr>
		<tr>
			<td> </td>
			<td><input type="submit" value="Submit" name="B2"></td>
		</tr>
	</table>
				<p> </p>
			</form>
			</td>
		</tr>
		<!--#include file="../_fpclass/fpdbrgn2.inc"-->




rdouglass -> RE: drw results in one form field (2/11/2008 14:25:23)

To include all the DB fields in 1 form field, I had something like this in mind:

<%DIM myTextData
myTextData = ""%>

		<!--#include file="../_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM recd_messages"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="test"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&EmailAddress=202&Message=202"
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<%myTextData = myTextData & FP_FieldVal(fp_rs,"EmailAddress") & ";"%> 
		<!--#include file="../_fpclass/fpdbrgn2.inc"-->
			<form method="POST" action="test2.asp">
	<table border="1" width="100%">
		<tr>
			<td>Combined Text</td>
			<td><textarea name="myText" rows="8" cols="39"><%=myTextData%></textarea></td>
		</tr>
		<tr>
			<td>Message:</td>
			<td><textarea rows="3" name="Message" cols="39"></textarea></td>
		</tr>
		<tr>
			<td> </td>
			<td><input type="submit" value="Submit" name="B2"></td>
		</tr>
	</table>
			</form>


What I have there should put all the field "EmailAddress" in the form field "myText" (separated by semi-colons if you notice) and leave the textbox "Message" blank.

Is that what you had in mind: something like that? Notice I put the form *outside* the DRW.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625