•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 401,425 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,879 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 8215 | Replies: 8
![]() |
| |
•
•
Join Date: Feb 2005
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
This was a question in a previous topic but I didn't quite understand the answer.
I display radio buttons from a Array I built in ASP (radioArray) which contains a code/short desc/long desc. When someone clicks a radio button I want to invoke a Javascript function to display the short and long desc directly below the list of radio buttons.
1. should I use onClick="return display_desc(this.selectedIndex)"
OR onchange="return display_desc(this.selectedIndex)"
2. How do I get radioArray into a JS array for the JS function?
Any code examples of would be very helpful since I am a novice at JS.
I display radio buttons from a Array I built in ASP (radioArray) which contains a code/short desc/long desc. When someone clicks a radio button I want to invoke a Javascript function to display the short and long desc directly below the list of radio buttons.
1. should I use onClick="return display_desc(this.selectedIndex)"
OR onchange="return display_desc(this.selectedIndex)"
2. How do I get radioArray into a JS array for the JS function?
Any code examples of would be very helpful since I am a novice at JS.
•
•
Join Date: Feb 2005
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by tgreer
I noticed this was unanswered. Speaking only for myself, I don't understand some of your terminology. I don't understand, when you speak of "arrays", whether you mean ASP arrays, JS arrays, or what.
Can you post some sample code? Or just describe in plain English what you're trying to do?
I built an ASP Array that contains a (code/short desc/long desc) and then I display Radio Buttons for as many items that are in the array. When someone clicks on any of the Radio Buttons I need to display the short and long description for that radio button directly below the listed radio button. It's my understanding that I need to convert the ASP Array into a JS Array so I can then perform a JS routine to read the JS array and display the correct desc.
Hope that makes sense, Thank You
•
•
Join Date: Feb 2005
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
The following is my current ASP code;
'Execute Stored Procedure and Load ASP Array
dim varMajCat() ' Array of Major Categories
set rsSub =cmd.execute ‘Executing SQL Server Stored Procedure
do until rsSub.eof
redim preserve varAppArray(3, intCount + 1)
varAppArray(1, intCount) = UCase(rsSub(strField1))
varAppArray(2, intCount) = UCase(rsSub(strField2))
varAppArray(3, intCount) = UCase(rsSub(strField3))
intCount = intCount + 1
rsSub.movenext
loop
'Loop thru the above Array & display the Maj Categories as Radio Buttons
Response.write("<Input Type='Radio' Name='MajCat' Language='_javascript' value='& varLocalArray(1, intCount) & ' onClick='return validate_radio_buttons()'>" & varLocalArray(2, intCount))
I need to figure out how to get the OnClick event to reference the data in the above Array and print the third element in an area that I will define directly below the Radio Buttons.
Thank you
'Execute Stored Procedure and Load ASP Array
dim varMajCat() ' Array of Major Categories
set rsSub =cmd.execute ‘Executing SQL Server Stored Procedure
do until rsSub.eof
redim preserve varAppArray(3, intCount + 1)
varAppArray(1, intCount) = UCase(rsSub(strField1))
varAppArray(2, intCount) = UCase(rsSub(strField2))
varAppArray(3, intCount) = UCase(rsSub(strField3))
intCount = intCount + 1
rsSub.movenext
loop
'Loop thru the above Array & display the Maj Categories as Radio Buttons
Response.write("<Input Type='Radio' Name='MajCat' Language='_javascript' value='& varLocalArray(1, intCount) & ' onClick='return validate_radio_buttons()'>" & varLocalArray(2, intCount))
I need to figure out how to get the OnClick event to reference the data in the above Array and print the third element in an area that I will define directly below the Radio Buttons.
Thank you
•
•
Join Date: May 2005
Location: Wellington, New Zealand
Posts: 182
Reputation:
Rep Power: 4
Solved Threads: 3
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Product List and Order Form Submit (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: javascript: radio buttons
- Next Thread: Replacing 100% tables with CSS



Hybrid Mode