navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Javascript help please

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Javascript help please
Page: [1]
 
Tailslide

 

Posts: 6003
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
Javascript help please - 4/15/2008 8:50:17   
Hi all

I've run into a Javascript problem and I've confused myself (happens a lot!). I'm hoping someone out there can point me in the right direction.

I'm using this script to show/hide a ton of form fields depending on whether a checkbox is checked:

<script type="text/javascript">
function toggle() {
if (document.getElementById) {
if (document.getElementById("person_subscription_birthday_club").checked == true) {
document.getElementById("birthdayclub").style.display = "block";
} else {
document.getElementById("birthdayclub").style.display = "none";
}
}
}

</script>


With this:

onclick="toggle();"


in the checkbox input itself.

All fine and dandy - works very nicely thank you.

The problem is on the otherwise identical - update profile form, I want to check onload if the checkbox in question is already checked and either show or hide the rest of the stuff accordingly. Then also have the current functionality.


_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project
Tailslide

 

Posts: 6003
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: Javascript help please - 4/15/2008 9:16:36   
:) Course I worked it out by myself 5 minutes after posting here... ignore me.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Tailslide)
mar0364

 

Posts: 3080
Joined: 4/5/2002
From: Florida, US
Status: offline

 
RE: Javascript help please - 4/15/2008 9:41:37   
I use to do that in the "ASP Database" section all the time. LOL

_____________________________

Easy Web

“Stay committed to your decisions, but stay flexible in your approach.”


(in reply to Tailslide)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Javascript help please
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts