Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > show/hide divs on checkbox click

Reply
Thread Tools

show/hide divs on checkbox click

 
 
Mike P
Guest
Posts: n/a
 
      11-14-2007
I am trying to hide/show divs based upon whether or not a checkbox is
clicked. Here is what I have done so far to check if the method is
being called correctly, but I am getting the javascript error 'object
required' :

function HideShowContactDetails()
{
if (document.Form2.ContactType.value == "true")
{
alert ("Contact Type selected");
return false;
}
else
{
alert("Contact Type unselected");
return false;
}
}

<form action=processAddCompanyAndContact.asp?process=ame nd method=post
onSubmit="return Validate2()" name="Form2">

<input type="checkbox" name="ContactType"
onClick="HideShowContactDetails()" />





*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Dooza
Guest
Posts: n/a
 
      11-14-2007
Mike P wrote:
> I am trying to hide/show divs based upon whether or not a checkbox is
> clicked. Here is what I have done so far to check if the method is
> being called correctly, but I am getting the javascript error 'object
> required' :
>
> function HideShowContactDetails()
> {
> if (document.Form2.ContactType.value == "true")
> {
> alert ("Contact Type selected");
> return false;
> }
> else
> {
> alert("Contact Type unselected");
> return false;
> }
> }
>
> <form action=processAddCompanyAndContact.asp?process=ame nd method=post
> onSubmit="return Validate2()" name="Form2">
>
> <input type="checkbox" name="ContactType"
> onClick="HideShowContactDetails()" />


Don't you need to give the input a default value?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
click click click Andy Morrison Computer Support 7 12-20-2007 06:50 AM
swapping divs -- when divs NOT positioned absolutely.. maya Javascript 4 11-16-2007 05:11 PM
Managing divs within divs.... rich HTML 0 02-02-2006 07:38 PM
disable checkbox list checkbox Vikram ASP .Net 1 01-25-2006 02:59 PM
Text on Checkbox below the checkbox tshad ASP .Net 0 04-14-2005 11:26 PM



Advertisments