Stuart Radcliffe

One step at a time
posts - 196, comments - 69, trackbacks - 6

Starting Javascript with ASP.NET

I have tended to stay away from Javascript except for the most trivial of situations or easy modifications of other's code but it is becoming increasingly obvious that I can't really develop too far in web development without some ability at it.  So I'm going to make an effort to increase my use.

One of the areas that I have trouble getting right and need to work on is manipulating DOM elements.  As a first start to this I am going to remember a piece of code that changes the value of a Select when the value in another select is changed.  Trivial, but, one step at a time.

            Dim ScriptOnChange As String = "window.document.getElementById('KiltLengthDDL').selectedIndex=0;"
            ScriptOnChange &= "window.document.getElementById('WaistDDL').selectedIndex=0;"
            Me.TartanDDL.Attributes.Add("onChange", ScriptOnChange)

posted on Wednesday, December 21, 2005 11:24 AM