Ask a Question related to Dreamweaver AppDev, Design and Development.
-
-D- #1
asp array
I have a recordset value that is within a Do While Loop: <input name='fieldA'
type='hidden' id='fieldA'
value='<%=(rsAllocation.Fields.Item('ABR_DETLS_ID' ).Value)%>'> Every iteration
of the loop holds another value. So, if the loop executed 5 times, then I have
5 hidden fields with different values from the resultset. I want to capture
the all the values into an array and then pass the array as an argument into a
javascript function. I've had no difficulty passing in arguments that hold one
value, but I'm not sure how to handle multiple values? I have a variable that
I set as the counter for the Do While loop, so the loop counter variable holds
the number of loops that were executed. Creating my array as follows, would
this hold all the hidden field values from the resultset: Dim
myArray(loopCounter) Dim i For i = 0 to loopCounter myArray(i) =
rsAllocation.Fields.Item('ABR_DETLS_ID').Value Next then I want to pass in the
array as an argument to a javascript function: onClick='return
CheckForm='<%=myArray()%>' Should the array then hold the hidden field values
in a one dimensional comma delimited list? I can then split the values out
from the list and then use them in the function? Thanks, -D-
-D- Guest
-
Converting an XML Array to a multi-level array
I have an array assigned to a data grid such as: private var myIngredients:Array = new Array( <item ln1="Plain" sn="plain" ln2="(3 cups)... -
[newbie]saving and reading array of associative array
i'm looking for examples of saving to file and reading back an array of associative array, in a ruby like way. saying i have something like : ... -
array data matches but array created in loop doesn't work
I have the exact same data in two arrays, but only the array created like so will work: $spaw_imglibs = array( array( 'value' =>... -
#24897 [Com]: array_multisort() will reindex the array but not if array length is 1
ID: 24897 Comment by: franklin_se at hotmail dot com Reported By: chro at sokrates dot uio dot no Status: ... -
#24897 [Opn->Asn]: array_multisort() will reindex the array but not if array length is 1
ID: 24897 Updated by: sniper@php.net Reported By: chro at sokrates dot uio dot no -Status: Open +Status: ... -
CMBergin #2
Re: asp array
I know to pass arrays between javascript and VBScript, you have to pack it
into a string, pass it, then upack it. For VBScript it's easy:
myString = Join(myArray,", ")
myArray = Split(myString,", ")
I don't know how to join or split an array in javascript, but I bet a Google
search on "Javascript array from string" or "Javascript split string" or
something will get you someone who does.
"-D-" <webforumsuser@macromedia.com> wrote in message
news:cvnu0j$ehp$1@forums.macromedia.com...name='fieldA'> I have a recordset value that is within a Do While Loop: <inputiteration> type='hidden' id='fieldA'
> value='<%=(rsAllocation.Fields.Item('ABR_DETLS_ID' ).Value)%>'> Everyhave> of the loop holds another value. So, if the loop executed 5 times, then Icapture> 5 hidden fields with different values from the resultset. I want tointo a> the all the values into an array and then pass the array as an argumentone> javascript function. I've had no difficulty passing in arguments that holdthat> value, but I'm not sure how to handle multiple values? I have a variableholds> I set as the counter for the Do While loop, so the loop counter variablewould> the number of loops that were executed. Creating my array as follows,in the> this hold all the hidden field values from the resultset: Dim
> myArray(loopCounter) Dim i For i = 0 to loopCounter myArray(i) =
> rsAllocation.Fields.Item('ABR_DETLS_ID').Value Next then I want to passvalues> array as an argument to a javascript function: onClick='return
> CheckForm='<%=myArray()%>' Should the array then hold the hidden fieldout> in a one dimensional comma delimited list? I can then split the values> from the list and then use them in the function? Thanks, -D-
>
CMBergin Guest
-
Manuel Socarras #3
Re: asp array
the same more or less:
myString = myArray.join();
myArray = myString.split(",");
CMBergin wrote:
> I know to pass arrays between javascript and VBScript, you have to pack it
> into a string, pass it, then upack it. For VBScript it's easy:
> myString = Join(myArray,", ")
> myArray = Split(myString,", ")
>
> I don't know how to join or split an array in javascript, but I bet a Google
> search on "Javascript array from string" or "Javascript split string" or
> something will get you someone who does.
>Manuel Socarras Guest
-
-D- #4
Re: asp array
Hi CM, Thanks for your help and Manuels. Okay, if I understand correctly, I
can get get all the values from the resultset by creating my array like the
following: Dim myArray(loopCounter) Dim i For i = 0 to loopCounter myArray(i)
= rsAllocation.Fields.Item('ABR_DETLS_ID').Value Next That should populate the
array with every value for the recordset value 'ABR_DETLS_ID, yes? Then I need
to create a string in VBScript from the array? myString = Join(myArray,', ')
At that point, I can pass the string into the Javascript function:
onClick='return CheckForm='<%=myString%>' Finally, in the Javascript function,
I need to unpack it using the Javascript method: myArray =
myString.split(','); Is that correct? Thanks again! -D-
-D- Guest
-
CMBergin #5
Re: asp array
Got it in one!
Don't you love how complicated things can get?
"-D-" <webforumsuser@macromedia.com> wrote in message
news:cvo525$odk$1@forums.macromedia.com...I> Hi CM, Thanks for your help and Manuels. Okay, if I understand correctly,the> can get get all the values from the resultset by creating my array likemyArray(i)> following: Dim myArray(loopCounter) Dim i For i = 0 to loopCounterpopulate the> = rsAllocation.Fields.Item('ABR_DETLS_ID').Value Next That shouldneed> array with every value for the recordset value 'ABR_DETLS_ID, yes? Then I')> to create a string in VBScript from the array? myString = Join(myArray,',function,> At that point, I can pass the string into the Javascript function:
> onClick='return CheckForm='<%=myString%>' Finally, in the Javascript> I need to unpack it using the Javascript method: myArray =
> myString.split(','); Is that correct? Thanks again! -D-
>
CMBergin Guest



Reply With Quote

