Hey all i need a way for the user, when they choose a store from a cbobox to populate another cbobox depending on what the user choose in the first cbobox. I cant seem to execute a public sub once i put the onchange="" on the first cbobox. <select name="cboSelect" class="FieldStyleDropDown" id="cboSelect" onchange="FillBox"> <option value=" "> </option> <option value="GP">Gunbarrel Point</option> </select> Code (markup): <% Public Sub FillBox() blah blah blah... %> Code (markup): Am i leaving something out??? Thanks! David
OnChange is a javascript handler (client-side). You would need to use a javascript Function called FillBox() <script language="javascript"> function FillBox() { var ddb = document.getElementById("cboSelect"); //Handle to the DOM of the DropDown Box. ddb.whateverYouWantToDo; } </script>
Thanks for the reply ccoonen Problem is that i have a lot of stuff within the FillBox sub. Like gathering data from my mySQL server and such. Is there any way to call the asp sub using the javascript? David
Hmm, you could incorporate some Ajax, but I would say your best solution is to do a physical postBack. Then on next page load - fill the box, do your db interactions, etc... You don't need to do it in a function then. A good easy detection method is to post with a querystring like <form method="post" action="default.asp?submit=true"> then you do if trim(lcase(request.querystring("submit"))) = "true" then Run your Code.
Hmm, ok - I think we could find something for you - what technolog are you using? classic asp? I know asp.net AJAX was just released (a layer on top of asp.net) if you are going that route, otherwise we can work something out for for classic asp This is some AJAX I did about 2 years ago... if it helps you out to have an example http://www.dataweigh.com/order/view_order.asp - You'll see the dropdown lists's values change when you select a different dropdown value.
Hey thanks for the example - that is what i need mine to do. Yep, im old so im using the classic ASP David
To do? Please parse and look at the example at the site I provided: http://www.dataweigh.com/order/view_order.asp Here's another tutorial http://www.skeymedia.com/programming/classic-asp-and-ajax-tutorial/
HEHE, The second one is pretty easy follow, it might be a good starting point - then move on to my example which uses comboboxes... I could ofcourse do a real example for you (for a price) lol