see the 3 changes in your code, not tested but heading in the right
direction
HTH
Al.
On Fri, 9 Jan 2004 04:33:27 -0800, "Josema"
<anonymous@discussions.microsoft.com> wrote:
[color=blue]
>Sorry Dan,but my before explication was not correctly
>
>The question is that i have an array in asp with money...
>
>this array allways have the same number of elements, but
>the value of each element is dinamic
><%
>array(0)=5$
>array(1)=6$
>%>
>
>and in the browser i have one like this:
>
><select name=x onchange="document.form('FormNameHere').elements(' TextBoxNameHere').value = this.value; ">
><option value="<%=Array(0)%>">money1</option>
><option value="<%=Array(1)%>">money2</option>
></select>
>
>and a textbox simple
>
>My program must do this...
>If a user selects the option money1, the textbox.value
>must be 5$
>
>If a user selects the option money2, the textbox.value
>must be 6$
>
>Its like i cant connect the javascript with the asp,
>cause one execute in the server and the another in the
>client...
>
>[color=green]
>>-----Original Message-----
>>
>>"josema" <anonymous@discussions.microsoft.com> wrote in[/color]
>message[color=green]
>>news:0a0701c3d6a6$fdf5de90$a401280a@phx.gbl...[color=darkred]
>>> Hi to all
>>>
>>> I have a asp page that have an array for instance:
>>> <%
>>> a(0)=0
>>> a(1)=1
>>> a(2)=2
>>> a(3)=3
>>> %>
>>> I would like to show each element of the array with
>>> alerts in javascript... Do you know what its the way to
>>> make something like this...[/color]
>>
>>You need to write your server code into a locally held[/color]
>array - excuse my
JS[color=green]
>>if it's wrong in terms of syntax, but I tend to program[/color]
>in
VB and I'm not[color=green]
>>looking up the
JS syntax :-))
>>
>>So :
>> <%
>>a(0)=0
>> a(1)=1
>> a(2)=2
>> a(3)=3
>> %>
>><html>
>><body>
>><script language ="javascript">
>>var aLocal(3)
>>
>><%
>>iCounter = 0
>>for (iCounter=0;iCounter<a.length;iCounter++) {
>> Response.Write('aLocal(' + iCounter + ') = ' + a[/color]
>(iCounter) + vbnewline[color=green]
>>// Whatever the Jscript equivlant is - \n ?
>>}
>>%>
>>for(a=0;a<aLocal.length;a++) {
>> alert(aLocal(a))
>>}
>></script>
>></body>
>></html>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>.
>>[/color][/color]