Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to pass an array from asp to vbscript?

Status
Not open for further replies.

sandravega

Programmer
Feb 10, 2004
43
AR
Hi
I'm just trying to accomplish this:
I use asp to recover information from a table into an array.
I use asp because I want it in the server side... where the database is(uh, that's right, isn't it?I'm not sure)
Then I need to pass this array to an client-side function, just to repopulate a <select>. But the code says that something wrong with the array, it can't recognize it nor in vbscript nor in Javascript

I have some button like=

<input type="button" onClick="Repopulate(<%=myarray%>)" value="Repopulate Now!">

and a JavaScript function like

<script language="javascript">
function Repopulate(myarray)
var i;
objSel = document.frm1.myselect;
objSel.options.length = 0;
for (i = 0; i < myarray.length; i++)
{
var obj = new Option();
obj.value = myarray;
obj.text = myarray;
objSel.options[objSel.options.length] = obj;
}
objSel.options[0].selected = true;

end function
</script>

I know the js function does not work, it just don`t recognizes de array. May be is easiest in vbscript...

I asked this in the tree forums, the javascript one, the javascript and here...

Thank you a lot

Sandra
 
you're killing me with the cross posting. keep it to one forum unless otherwise suggested please.

The problem is originating with your ASP process so leave it there. THEN..figure out the client level errors. [smile]

___________________________________________________________________

The answer to your ??'s may be closer then you think. faq333-3811
Join the Northern Illinois/Southern Wisconsin members in Forum1064
 
not what I meant sandravega and if I didn't want to be bothered I wouldn't be here more then likely.

It's hard to keep track of what is what when you have multiple threads on the same topic at hand. It was a suggestion (unwritten forum rule).



___________________________________________________________________

The answer to your ??'s may be closer then you think. faq333-3811
Join the Northern Illinois/Southern Wisconsin members in Forum1064
 
Posting only in one appropriate column makes it easier for someone in the future with the same issue to find the solution.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top