I don't think you need to do that, that is what <@currow> does for
you automatically.
<select name="mySelect" size="1">
<@rows array=local$arrayW>
<option value="<@currow>"><@col 1></option>
</@rows>
</select>
However, I would STRONGLY suggest that you use the primary key in the
database of products as the option VALUE, and the name or description
or whatever as the option. So your select would be something like:
select pkey, name from products where whatever. So in this array local
$myArray, assuming column 1 is hte primary key, and column 2 is the
name:
<select name="mySelect" size="1">
<@rows array=local$myArray>
<option value="<@col 1>"><@col 2></option>
</@rows>
</select>
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On May 31, 2005, at 12:19 PM, [EMAIL PROTECTED] wrote:
Maybe if I simplified this a bit.
How can I assign a product name to an array then add a column that
counts.
ie...
<@ASSIGN NAME="ArrayW" VALUE="<@ARRAY ROWS='<@NUMROWS>' COLS='2'>"
SCOPE="USER">
<@ASSIGN NAME=ArrayW[*,1] "<@VAR resultSet[*,1]>">
to populate the array with product names
then populate column 2 so the array ends up like this...
first pruduct name 1
second product name 2
third product name 3
fourth product name 4
fifthe product name 5
etc.
Thanks, sorry about the brain fart... I think there must be an easy
way to do this.
etc.
This is what I have so far....
In the first search, I am assigning the array with these values.
This product numbers then product name. Don't need the product
numbers but a simple count here woudl do for <@VAR resultSet[*,1]>
<@ASSIGN NAME="ArrayW" VALUE="<@ARRAY ROWS='<@NUMROWS>' COLS='3'>"
SCOPE="USER">
<@ASSIGN NAME=ArrayW[*,1] "<@VAR resultSet[*,1]>">
<@ASSIGN NAME=ArrayW[*,2] "<@VAR resultSet[*,2]>">
<@ASSIGN NAME="totalrows" VALUE="<@NUMROWS>">
Then I am doing a looping count called m_counter
I think this is where I would need to update the current array is
it not? This is where I would like to change the <@VAR NAME='ArrayW
[*,1]'> to a simple count so I could use it for startrow in the
next search.
In the choice list, I now have the options right, but need the
values to be the count. Is this making sense? Or is there a better
way to do this?
<@CHOICELIST NAME="pick" SIZE=1 TYPE=select VALUES="<@VAR
NAME='ArrayW[*,1]'>" OPTIONS="<@VAR NAME='ArrayW[*,2]'>"
SELECTED="selected">
(sorry, a typo)
For the simple drop down, it's going to look more like this
given: you have an array: @@myArray and a field = myName
<@choicelist name="myName" size=1 options=@@myArray[*,1]
Values=@@myARray[*,2] >
of course, myArray can be all of your products that is held in a
persistent variable, or the product of a prior query. It can be
filtered, sorted, and tortured to you preference. It's just got 2
columns that you care about, and you're using one for the values
and one for the display.
On May 31, 2005, at 9:43 AM, [EMAIL PROTECTED] wrote:
Okay, it seems that choicelist is the way to go. I have never
had a need for this, so please bear with me as I muddle through
this.
I have built an array that has 2 values, one is the product
number, the other is the name of the product. I cannot see how
to display the product name as what the user sees and the
product number as the value when selected. Anyone know if this
can be done?
In other words
<option value="<product number>">Blue Widgets</option>
Thanks
look at <@choicelist>
On May 31, 2005, at 8:52 AM, [EMAIL PROTECTED] wrote:
Witango 2000
Is it possible to build a dropdown to be used on another search.
In other words, I have a page that displays 5 products per
page. That's easy enough. But I need to have a dropdown of all
the products on that same page. I have been trying to do this
by bulding an array, but cannot seem to get it to work right.
The problem is the array has to be built on a search before
the main search page.
Logic would dictate that
Array search -- > build an array for all products
Main search --> Need to drop in a form dropdown here for all
products even though this search only displays 5 products at a
time.
Is this making sense? All I get is a list of the products, but
I cannot seem to get them to display in a drop down. Seems
that it reverts to just text.
_________________________________________________________________
___ __ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/
maillist.taf
__________________________________________________________________
___ ___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/
maillist.taf
___________________________________________________________________
___ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
____________________________________________________________________
____
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
_____________________________________________________________________
___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf