asp:CheckBox oncheck="function1();" onUncheck="function2(); how do I?

Currently I have:

<asp:CheckBox runat="server" Enabled="true" ID="alreadyowndomain" Text="I already own the domain name(s) I need."  onclick="slidedown('alreadyTakenDiv');" onUnCheck="slideup('alreadyTakenDiv');" />

onclick works.
onUnCheck doesn't work.

What I am trying to do is get slidedown('alreadyTakenDiv'); when checked.
and slideup('alreadyTakenDiv') when unchecked.

How can I do this?

Thanks sooo much ahead of time.
igotstehsolutionAsked:
Who is Participating?
 
leakim971PluritechnicianCommented:
And this :


function slide(s,o) {
            if (s) {
                slidedown(o);
            }
            else {
                slideup(o);
            }
        }

Open in new window

0
 
AkshCommented:
Set AutoPostback to true
0
 
igotstehsolutionAuthor Commented:
AutoPostback breaks the javascript.

Anyways I do even know that onUnCheck is a real attribute. I put it there as an example.

Ideally i would need 2 attributes such as onCheck and onUnCheck where I could put a function in each.

Is this possible and how can I do this?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
leakim971PluritechnicianCommented:
Use this :


<asp:CheckBox runat="server" Enabled="true" ID="alreadyowndomain" Text="I already own the domain name(s) I need." onclick="slide(this.checked,'alreadyTakenDiv');" />

Open in new window

0
 
igotstehsolutionAuthor Commented:
that breaks the function aswell.

<asp:CheckBox runat="server" Enabled="true" ID="alreadyowndomain" Text="I already own the domain name(s) I need."  onCheck="slidedown('alreadyTakenDiv');" onUnCheck="slideup('alreadyTakenDiv');" />

I need it to look like the tag above. The only problem is I don't think onCheck or onUnCheck are real attributes.
0
 
leakim971PluritechnicianCommented:
onCheck and onUnCheck is not javascript attributes but ASP.NET attributes so running on the server side.

>that breaks the function aswell.
Why ? You call an intermediate function to call the right one (the onUnCheck or onCheck method)
0
 
igotstehsolutionAuthor Commented:
didn't see function when typed response. testing now :)
0
 
igotstehsolutionAuthor Commented:
Works perfect thank soo much!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.