Form Fields Collection

S

sean

HI There,

I am trying to collection the values of my form when it submitted, the page
itself has a dynamically generated for like the one below. Each of the rows
has a unique number assigned to it using a counter in the loop, I would like
to try to read the values when the form has been submitted and only write
the rows into the db where the quantity has changed from null to a number. I
have tried using the instr function to seperate the fields but I have had
not luck.

Could someone help me out with a little syntax for this ?

Sean - thanks in advance




<INPUT type='hidden' NAME='productid_1' ID='productid_1'
value="3TTT:IBARXN">

<INPUT type='hidden' NAME='price_1' ID='price_1' value='10'>

<INPUT type='text' size='5' NAME='quantity_1'>




<INPUT type='hidden' NAME='productid_2' ID='productid_2'
value="3TTT:IBARXN">

<INPUT type='hidden' NAME='price_2' ID='price_2' value='10'>

<INPUT type='text' size='5' NAME='quantity_2'>
 
A

Armando

I'm assuming each time the form loops, it has three fields (product_#,
price_#, quantity_#).

If you only want to do a db write during your loop where quantity is not
null then here's what I think it would look like (if I'm understanding you
correctly):

for i = 1 to [number of form loops]
if request.form("quantity_"& i) <> "" then
'insert your db writing code here
end if
next

Cheers.

Armando
 
S

sean

HI Armondo,

Thanks for all of your help, I really appreciate it.

Sean



Armando said:
I'm assuming each time the form loops, it has three fields (product_#,
price_#, quantity_#).

If you only want to do a db write during your loop where quantity is not
null then here's what I think it would look like (if I'm understanding you
correctly):

for i = 1 to [number of form loops]
if request.form("quantity_"& i) <> "" then
'insert your db writing code here
end if
next

Cheers.

Armando



sean said:
HI There,

I am trying to collection the values of my form when it submitted, the page
itself has a dynamically generated for like the one below. Each of the rows
has a unique number assigned to it using a counter in the loop, I would like
to try to read the values when the form has been submitted and only write
the rows into the db where the quantity has changed from null to a
number.
I
have tried using the instr function to seperate the fields but I have had
not luck.

Could someone help me out with a little syntax for this ?

Sean - thanks in advance




<INPUT type='hidden' NAME='productid_1' ID='productid_1'
value="3TTT:IBARXN">

<INPUT type='hidden' NAME='price_1' ID='price_1' value='10'>

<INPUT type='text' size='5' NAME='quantity_1'>




<INPUT type='hidden' NAME='productid_2' ID='productid_2'
value="3TTT:IBARXN">

<INPUT type='hidden' NAME='price_2' ID='price_2' value='10'>

<INPUT type='text' size='5' NAME='quantity_2'>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,147
Messages
2,570,833
Members
47,378
Latest member
BlakeLig

Latest Threads

Top