Well I finally figured out a way to do this. I couldn't get the
document.getEle mentById thing to work, and I'm sure there must be a
more concise way to do this (for example, passing an array) but I don't
know Javascript well enough. At this point, I don't care. I got it to
work, so I'm supplying the complete solution for the other poor souls
out there trying to do the same thing. As a reminder, what this does
is, when the user clicks the asp:RadioButton whose ASP ID is
rbtnS0start, I want the client to run Javascript in the .aspx page so
that the asp:RadioButton s named rbtnS1start thru rbtnS6start
automatically get checked.
In the code-behind page I have this code:
protected void Page_Load(objec t sender, EventArgs e)
{
if (!IsPostBack)
{
rbtnS0start.Att ributes.Add("On Click", "rbtnS0start_Cl ick("
+
rbtnS1start.Cli entID + "," +
rbtnS2start.Cli entID + "," +
rbtnS3start.Cli entID + "," +
rbtnS4start.Cli entID + "," +
rbtnS5start.Cli entID + "," +
rbtnS6start.Cli entID +
");");
}
}
In the .aspx page, I included the following code just before the
</asp:Contenttag (which is the last tag on the page)...
<script type="text/javascript">
function rbtnS0start_Cli ck(b1,b2,b3,b4, b5,b6)
{
b1.checked = true;
b2.checked = true;
b3.checked = true;
b4.checked = true;
b5.checked = true;
b6.checked = true;
}
</script>
Could this have possibly been made any harder to do!!??
On Jan 26, 9:29 am, "Barry" <dys...@gmail.c omwrote:
Ok, now I want to work with my client controls (instead of just popping
up an alert). For instance when they click rbtnS0start I want the
javascript on the client to set rbtnS1start (another asp:RadioButton )
to be 'checked=true'. I've tried things like: rbtnS1start.Che cked =
true; but apparently that's not right because it doesn't check the
button or execute the rest of my javascript.
Obviously I'm quite new to client-side scripting, so any help/pointers
you can provide would be most appreciated. (Btw, I'm on the clock, so
the sooner someone will help me the better.)
Thank you!!
On Jan 25, 1:17 pm, "Barry" <dys...@gmail.c omwrote:
Oh what a difference a couple of curly braces make! Imagine 9 hours
wasted because I didn't have the curly braces :-(. Thank you both very
much!!
On Jan 24, 8:14 pm, "Mark Rae" <m...@markNOSPA Mrae.comwrote:
"bruce barker" <nos...@nospam. comwrote in messagenews:%2* *************** @TK2MSFTNGP05.p hx.gbl...
you need to legal javascript syntax to define the function.
<script type="javascrip t">Or even
<script type="text/javascript">
if you want to be XHTML-compliant...- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -