On Tuesday, August 19, 2003, at 06:26 AM, Roland Dumas wrote:

What I have so far:

on the form side:
for each field name, you append<@CURROW> so that if you have 'productID' as your field, it will appear on the form as 'productID1' and 'productID2' as it lays down the rows.

When you submit, it will send everything. I make the @totalrows a postarg also by doing a hidden field with that being passed as <@ARG ROWS>

now I whip out my manual and figure doing things by analogy....
when it gets to witango, I assemble the mess of postargs into one variable that is comma delimited. sorta like this:

<@ASSIGN 'initvalue' request '
<@FOR <@ARG >
<@ARG ,
<@ARG ,
<@ARG ,
<@ARG ;
</@FOR>
'>


so it loops through your field names and adds the value from those fields onto the end of this new variable. it makes it comma/semicolon delimited, too.

now, it is ready to assign to an array

According to the book, I just go:
<@ASSIGN "mynewarray" request "
<@ARRAY <@ARG ' '4' ',' ';' '<@VAR name=initvalue scope=request' >
>


and I'm home.

Well, not yet. I get two kinds of response from witango. One that says my initial value and the array dimensions are outa whack, or just an empty array. I plug in a string of '1,2,3,4;' and it works, but not with the variable plugged in. by doing some experimenting ... Near as I can tell, either the @ARGs or the way I created the initValue pad the values with spaces and that gives the @ARRAY tag indigestion.

almost there. just gotta figure out if I'm responsible for the padding or if I need to trim everything.

the spurious space was my fault. this approach works.
On Tuesday, August 19, 2003, at 05:21 AM, Mystery Dev wrote:

Hey thats a darn good question.

I got to do this myself soon in my project.

Are you showing the form data as rows of products with a checkbox next to each one? with a quannty text field to?

THen only making an array of the checked items with the quanity number and product key, after the form is submitted?

I guess we need to loop on the number post argumnets received. Is there a Meta tag that contains the argument collection?

In ASP that would be Request.Form then you get a Count and loop on it and pull out the argument names and values.

Hmmmm

--- Roland Dumas <[EMAIL PROTECTED]> wrote:
Is there an example of a web form with many rows being converted to an
array? I've got a bit of a brain freeze.

that is: searching a product db to create an foundset list that is
presented in a storefront order form. when the form is submitted, it
gets turned into an array.

thanks for any help. sorry the q is so basic.

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

_____________________________________________________________
The best email provider on today's market, sign-up now for as low as $20.00 AUD per year! http://www.aussiemail.com.au
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

Reply via email to