Multi Dimensional Array In Form

what i want to do is have a (multi dimensional?) array, so that each second dimension represnts a row of radiobuttons. The trouble is i don't know what to name the arrays as. Obviously for each row the names for the different radio buttons will be the same, meaning you can only select one.

in php you could do it with a single array as you name each row of radio button differently:

1st row:
name='array[0]'
2nd:
name='array[1]'

in asp it doesn't look like you can do it this way, because to create a similar array you'd do something like
1st row:
name='array'
2nd
name='array'

then use split in the recipient script. This does not work however, because each radiobutton (on all rows) has the same name, and therefore when you click one all the rest on every row are unclicked..

View Replies


ADVERTISEMENT

Creating Multi Dimensional Arrays On The Fly

I am trying to setup a 2 dimensional array which i can populate on the fly with data coming frtom a database.

I understand that you have to set a specfic size for the array in ASP, but I am looking at making the array dynamic and using the Redim function to increase the size by 1 each time. Code:

View Replies View Related

Subscripts And Dynamic Multi-dimensional Arrays

I am trying to create a dynamic multi-dimensional array, based on a count from a database. The count is correct, but when I try to Redim preserve my array, I get an error...

Subscript out of range

referring to the line of code...

ReDim Preserve builderArray(CInt(builderCount),5)

How can I do this redim successfully?

View Replies View Related

One Dimensional Array

If I have an Array declared like this:

MyArray = array (“value 1”, “value 2”, value 3”)

Will this array physically be a long single row or a single column (like below)?

Value 1 value 2 value 3

Or

Value 1
Value 2
Value 3

View Replies View Related

Looping Through Tw-dimensional Array

I need to loop through a two-dimesnional array (x,y) until a value in x is empty or the end of the array is reached, whichever comes first. Example array:

Dim myArray(4,1)

myArray(0,0) = "part 1"
myArray(0,1) = quantity
myArray(1,0) = "part 2"
myArray(1,1) = quantity
myArray(2,0) = "part 3"
myArray(2,1) = quantity
myArray(3,0) = ""
myArray(3,1) = quantity
myArray(4,0) = "part 5"
myArray(4,1) = quantity

In the example above, the loop should stop once it determines myArray(3,0) is empty. If myArray(3,0) was not empty, the loop would continue until the end of the array was reached. Anybody have a code example to do this?

View Replies View Related

Two-Dimensional Array Resizing

how do I resize a two-dimensional array? The array I'm working with is "data(X)(Y)" where X is 0 or 1 and Y grows to a dynamic number.If "data(1)(highest element)" IsNull, then I need to strike it from the array. I believe this should be doable by simply resizing the second dimension down by one. Through researching I established the following set of code:

I = UBound(data(0)) - 1
ReDim Preserve data(2,I)

But it results in a "Subscript out of range" message on the latter line. Short of looping through and building a new array.

View Replies View Related

ADODB Versus 2-Dimensional Array

I'm working on developing (yet another) shopping cart for my work. I was wondering if anybody knows which approach leaves a smaller footprint in memory on a server: an ADODB Recordset which stores arrays one-dimensional arrays or a two-dimensional array?

We are currently hosing our web site on a shared machine at Verio. The cart I have to build needs separate carts because a customer's products can come from different locations. Each location will have a different cart. On the cart page itself, I would like to display each cart in a separate location.

Logically, it make the most sense (to me, anyway) to use an ADODB Recordset to manage each individual cart (array) than to write the code to manage the arrays. What are the disadvantages of using ADODB recordset instead of a two-dimensional array in this case?

Which approach would be easier to manage and manipulate? Are there any reasons why I shouldn't use a two-dimensional array? The nice thing about ADODB is that I will not need to program certain features and have access to FILTERS.

Any suggestions about how each approach would scale as site traffic increases? Will one approach bog down the server more than the other? I'm also open to suggestions about a possible, yet illusive, 3rd way.

View Replies View Related

Vbscript Mutli Dimensional Array

I understand the logic behind a multi dimensional array (sort of). What I need to do is be able to capture the product information (that is in a product session) that a user has selected and email it to a specific address.

The email coding page is written in javascript. This page is already being used to also send the customer credit information. If anyone has some insight in this I would be very appreciative. Code:

View Replies View Related

Retrieve Multi Dim Array Value

I needed to print the values of a multidim array. I know it can be done by saying <%=array(i,j)%>. But my array is three dimensional and doesn't print any values if i say <%=array(i,j,k)%>. This array was declared as Dim vretdata and what it does it retrieves data from the database through a function. Code:

View Replies View Related

Retrieve A Particular Multi-dim Array Value

I needed to print the values of a multidim array. I know it can be done by saying <%=array(i,j)%>. But my array is three dimensional and doesn't print any values if i say <%=array(i,j,k)%>. This array was declared as Dim vretdata and what it does it retrieves data from the database through a function. Code:

View Replies View Related

Multi-Dimentional Dynamic Array

I want to save the details of a SQL search into an Array, Im dabbling and tryin the script below but i get an error Script:

SQL = "select item, number from table"
Set rsTarg = Conn.Execute(SQL)

i = 0

Dim TargArray()
Redim TargArray(i, 1)

do until rsTarg.eof

TargArray(i, 0) = rsTarg("item")
TargArray(i, 1) = rsTarg("number")

i = i + 1

Redim Preserve TargArray(i, 1)

rsTarg.movenext
loop

rsTarg.close

i = i -1

View Replies View Related

Bubble Sorting A Multi-dimention Array

What I need to do is sort an dimention array by the name field and the best way I can think of to do this is by a bubble sort. However, I'm running into a problem with the bubble sort and I'm sure I'm just missing something simple.Here is the code I have Code:

Dim objAllBrands, objBubbleArray, a, i

For i = 1 to objAllBrands.count
For a = 1 to objAllBrands.count
If objAllBrands.item(a).Name < objAllBrands.item(i).Name then
objBubbleArray = objAllBrands.item(i)
objAllBrands.item(i) = objAllBrands.item(a)
objAllBrands.item(a) = objBubbleArray
End if
Next
Next

It doesn't like this line objBubbleArray = objAllBrands.item(i) and I'm sure there are other problems. Can anyone give me a hand with this?

View Replies View Related

How Can I "ReDim" A Two-dimensional Array?

I guess one should declare the array using empty brackets.

Dim MyArray()

Later I set MyArray to:

Redim MyArray(2,3)

The problem comes now. How should I use Redim again? I have heard that only one of the two dimensions can be enlarged or decreased. Is that correct? If so, which dimension would be ok to set to 5 in MyArray. Is ReDim MyArray (2,5) correct or should it be (5,2)?

View Replies View Related

Multi Form Insert

How would you go about inserting data from two forms into one record? using access/javascript

View Replies View Related

Multi Page Form

I am writing a multi page form. I am using hidden input statements to pass my variables between different pages. Now I want to provide a page whereusers can update the previous entered data. The form at this point is populated through the hidden variables.

But as I submit after making any changes. the hidden values instad of updating get an extra value. Is there any way to get around it.

View Replies View Related

Multi Page Form To Email.

I have been investigating how to create a multi page form in Frontpage that
eventually will allow an emailed result. I can write the asp to "post" from one
page to the next easily enough but when it comes to the last page, I can't
figure out how to email the results. the syntax "response.write" will write to a
web page but it won't fill in the content of am email. I thought of putting the
"response.write" inside the body of a CDO.message but that leads to the next
question...

While looking at threads about the subject I keep seeing that I should use
CDO (or CDONTS) or a third party app like aspmail. All of which, from what I can
gather, use IIS SMTP service to function.
The problem I will have is that I have Exchange 5.5 on the same machine so
the SMTP on IIS won't start since ex5.5 uses that port. I have ex2k on another
machine that I will soon move the users over to so that will free up the IIS
port but I would prefer using the new mail server for this when it is running.
Is there a method for using the ex5.5/ex2k mail system for sending the asp
generated email? or perhaps another technique? I would prefer to just write it
but if I have to buy something I will.

View Replies View Related

Creating A Form With Multi Select

I am trying to create a form where you may have more than one person
at a meeting, but want to have them be related to the same meeting.

I have a mulitple select text area and if you select more than one,
all the records are being added to the same row. so if I picked the
following three people:

(Person ID/Desc)
1 - mickey mouse
2 - donald duck
3 - goofy

The row in the data base would look like this:

(Meeting ID/ Person ID)

1 - 1,2,3

But I would like to do this:
(Meeting ID/ Person ID)
1 - 1
1 - 2
1 - 3

I hope this makes sense, if it does does anyone have a suggest on how to best do this?

View Replies View Related

Uploader With Multi Element Form

i need to find some scrit to uploadimages but with multi elements form i mean i need to put some textboxes and compo boxes with the uploading form to process the data entered in the text boxes and copbo boxes something = the posting new thread u can write ur thread and choose file to attach hope it's clear.

View Replies View Related

Multi-Page Form And Redirect Problem

I have a multi-page asp form:

index.asp
page2.asp
page3.asp
page4.asp

The form fields are carried from page to page using... Code:

View Replies View Related

Two Dimensional Arrays

how to get and assign the first dimension of a two dimensional array to another array? For example, I have a recordset object (rsObj) and then I take that object and assign to array (via GetRows() method). I would like to take just the first dimension and assign to another array, but I get a "Subscript Out of Range" error.... any ideas?

temp_array = rsObj.GetRows
new_array = temp_array(0)

View Replies View Related

Form Into Array & Database.

What I need to do is to create a form of a dynamic size, and then save
everything from the form in a database. The number of forms depends on
a number from the database which I know how to get. I need to have a
comment and a number, for example if the number from queried from the
database is 2, then I need 2 forms, and it would be something like so:

Comment: Something
Number: 4

Comment: SomethingElse
Number: 6

When the user clicks the submit button, this would be saved in a
database in a table, in a new row. I have the database created and
inserting works very good when inserting just one row, but I need to
insert more then one row at a time, so it would be something like
this: Code:

View Replies View Related

Array In Request.form

can i use array in request.form?
how can i use it?

View Replies View Related

Transfer Array From One Form To Another

I would like to ask how to pass an array from one form to another. I have tried below but it cant work...

View Replies View Related

Array In Form Post

I have problem getting right info using array.

When I post data with form:
<% i = 1 %>
<input type="text" name="Boys(<%=i%>)">

and retrieving the data on another page:
<%
i = 1
Response.Write Request.Form("Boys(i)")
%>

I do not see the data. If I replaced "Boys(i)" with "Boys
(1)", I can see the data. What am I missing?

View Replies View Related

Storing Dimensional Arrays

Does anyone know how to store multi-dimensional arrays in the Application object? And if so please show an example.

Also, how do you loop through multi-dimensional arrays? I just can't seem to get my head wrapped around this.

View Replies View Related

Referencing (many) Form Fields In An Array

I am trying to do some client-side form validation using vbscript. The form consists of 15 rows, with five fields in each row. For example, I want to be able to look at the contents of the 3rd field in the 9th row. How do I reference that field using vbscript? Do I loop through a collection?

View Replies View Related

ASP Form Array - Delimiter Problem

I'm submitting various form variables as arrays, so when I do try to
access them when the form is submitted, i do a split on the variable
and pop it into an array.

for example:
aDescriptions = split(request.form("strDescriptions"), ", ")

The problem however is if a description contains a comma in the text,
it throws off the split function.

Question is, is there a way to change the delimiter of the form array
to something other than a comma. Or does anyone here know a more
elegant workaround.

View Replies View Related

Various Basic Questions Regarding Two-dimensional Arrays

I would like to know how many rows and columns are created in the following array. Is it 10 rows and 2 columns or is it 10 columns and 2 rows? Dim Array(9,1)

I have searched for some info about it but not found any consensus. Some sources claim that the first number symbolizes the rows and the second number the columns and other sources claim the opposite. I am confused.

What is it really like? How many rows and columns?

Assume that I need an array with 2 columns and 5 rows then how should it be declared (4,1) or (1,4)?

Which is the first dimension and which dimension it the second one? Horizontally (first/second) vs vertically (first/second)?

How are the various elements called, for example how is the element on the first row in the 5th column called. By using (0,4) or (4,0)?

Assume that I want to store first and last names in two separate columns in an array and then expand the array by using Redim/preserve. The dimension I want to expand is the one with the rows because I view the array as a table with two columns.

I know there are certain rules that apply when it comes to using Redim/preserve on multidimensional arrays. Only the last dimension can be changed etc. How could that be done in this case? I am mainly interested in the declaration (1,x) or (x,1), where 1 is the number of columns and x number of rows (that is increased).

View Replies View Related

How To Use Variables Of An Array In ASP To Client Script In The Same Form ?

I have an array varibles in ASP script and i want to use these

varibles again in client Script (in VBScript) .

View Replies View Related

Asp: Pass Array Element Values To Form On Next Page

how to create an array of checkboxes that were selected from a form on one page and pass them into hidden fields in a form on the next page? I have this massive project I've been working on and am having trouble with this.

View Replies View Related

How Do I Retrieve Values Of An Array Variable From A Form To An Asp Page?

if i have a vbscript function on a certain form and I assigned some values on an array variable on that function, is there a way for me to retrieve the values of that array on another asp page once i submitted the form?

View Replies View Related

Rebuilding Of An Array From An Existing Array

I dump the entire recordset into an array:

If not rs.EOF Then
aEmp = rs.GetRows()

Contents of the array are in this order:

EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName

This query sort on the basis of Lft and Rgt columns.

The name of the array is: aEmp.

My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.

Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.

View Replies View Related

Array Integers Vs Array Variables

In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven't see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.

Ex.

Dim b
b = 10
Dim a(b) ' this errors out but
Dim a() ' this
Redim a(b) ' works

Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved