Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 Array

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-03 : 08:59:14
generatiownithoutname writes "Hii, can any one help me ???
1. How can i "tranforms" array returned by GetRows Method
into javascript array
2. I want to display specific data into one combobox control depending on value of another combobox control, i think it can be done by javascript array, but i don't now how...

Thank's a lot"

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-07-10 : 14:42:11
This is not at all a SQL question, but you're in luck, because I have done this. However I didn't come up with any simple quick conversion because you're dealing with changing from server-side script to client-side script. So, what I did was write my server-side script to loop through records and build the JavaScript code that builds the arrays on the client side. Then, yes you can swap contents of combo boxes using JavaScript.

I can't write out a solid explanation of how to do this in the short time and space I have here. I recommend you go get a really good JavaScript reference (I used Pure JavaScript) and do some research online into JavaScript arrays. You'll need to understand the different ways to build JS arrays, and it helps to understand the options.selectedIndex. I'll tell you this, it wasn't particularly elegant, but it worked as a proof-of-concept. We never ended up implementing it in production, though.

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-07-10 : 18:11:56
Oh Mark, how quickly we forget:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=11833

There's some code in there that will split a string into a JavaScript array very nicely.

Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-07-11 : 14:32:40
quote:

Oh Mark, how quickly we forget:



I'm so ashamed... Thanks for the reminder, Rob!

Go to Top of Page
   

- Advertisement -