Forums

ASP

This topic is locked

Insert multiple form fields into one DB field

Posted 15 May 2006 22:14:32
1
has voted
15 May 2006 22:14:32 Roger Hughes posted:
DWMX | ASP | ACCESS

Hi All,
Please help! I am trying to locate tutorial or extention to allow me to insert the values from multiple form elements into one access DB field.

i'e - checkbox 1 checkbox 2 checkbox 3 when all selected would insert 123 into one DB field.

This ones giving me a headache!

Hope you can help.

Many thanks in advance

Replies

Replied 16 May 2006 05:53:30
16 May 2006 05:53:30 micah santos replied:
are the values of each checkbox pulled out from a database record?
Replied 16 May 2006 10:21:32
16 May 2006 10:21:32 Roger Hughes replied:
Hi,
No. they are static form elements with static values.
Replied 16 May 2006 16:56:55
16 May 2006 16:56:55 micah santos replied:
This will give you a value of "123"
<%

Dim func
func = Request.Querystring("func"

If func = 1 Then

Dim strCheck,intRecIDs,arrRecIDs

intRecIDs = Replace(Request.Form("id", "*", ""
arrRecIDs = Split(intRecIDs, ", "

For i = 0 to Ubound(arrRecIDs)

strCheck = Replace(Request.Form("glCheck_" & arrRecIDs(i)), "'", "''"

response.write strCheck

Next


Else

%>
<form method="post" action="multiple.asp?func=1">

<input type="hidden" name="id" value="1">
<input type="checkbox" value="1" name="glCheck_1">1

<input type="hidden" name="id" value="2">
<input type="checkbox" value="2" name="glCheck_2">2

<input type="hidden" name="id" value="3">
<input type="checkbox" value="3" name="glCheck_3">3

<input type="submit" name="Submit">

</form>

<% End If %>
Replied 16 May 2006 16:59:13
16 May 2006 16:59:13 Roger Hughes replied:
Magic, your a legend!

Thanks
Replied 06 Jun 2006 03:43:31
06 Jun 2006 03:43:31 John Hooper replied:
hey,
i am trying to do this same thing but pull the values from a database record (i have made an add page following the instructions in this forum topic and now am making an edit page..),
how would i go about this?
cheers

Reply to this topic