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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

leakim971PluritechnicianCommented:
And this :


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

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.