Practical eCommerce

Pinnacle Cart

Your Profile · Log in to check your private messages · Log in · Register · Search Forum · F.A.Q.'s

HOME · Saturday, July 5, 2008

Community Forum

Practical eCommerce Community Forum Index » Design, Development & Usability

Combining CSS and JavaScript to Save Page Space

Post new topic   Reply to topic
Author Message
=IceBurn=



Joined: 18 Apr 2007
Posts: 2

PostDate: Wed Apr 18, 2007 3:58 pm   Subject: Combining CSS and JavaScript to Save Page Space Reply with quote

Hi, this is a nice tutorial (Related tutorial: Combining CSS and JavaScript to Save Page Space), but I have one question...

What if for example the box is checked by default?

As if it is checked when the user access the page, I would like that the hidden field was visible and if he uncheck the box than the field get hidden.

Thank you in advance.
Back to top
bgetting
Online Director


Joined: 08 Jan 2006
Posts: 170
Location: Newport, Oregon

PostDate: Thu Apr 19, 2007 7:36 pm   Subject: No problem Reply with quote

Simply change this part of the code in that article (in the JavaScript document) from this:

Code:
if (sourceId.checked){
target.style.display = "block";
} else {
target.style.display = "none";
}


to this:

Code:
if (sourceId.checked){
target.style.display = "none";
} else {
target.style.display = "block";
}


that should reverse the effect.
Back to top
=IceBurn=



Joined: 18 Apr 2007
Posts: 2

PostDate: Thu Apr 19, 2007 9:14 pm   Subject: Reply with quote

Thank you for your reply, but is not that simple.
The fact is that the box may or may not be checked...

This is for a shopping cart I'm developing, and I want to use something like this in the admin panel so the admin can set speccial offers.

So the box is checked if the prodduct has a speccial offer and unckecked if does not when the admin access the page to edit the product details.

So if the box is checked it was supposed to the promo price field was visible... but hidden if the box is unchekced...

Reversing the function does not work has expected...

If you have an idea how to do this that would be great. As I'm not that good in JavaScritp as I am in PHP for example.

Thanks in advance.
Back to top
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 1
Practical eCommerce Community Forum Index » Design, Development & Usability


 

Ecommerce Articles

Browse All Articles
Browse our complete archive of ecommerce articles.
Accounting, Management & Legal
Ecommerce articles related to managing a small business including ecommerce accounting, business strategy and legal considerations.
Conversion & Usability
Online business articles about converting web site visitors into customers and how to gauge and improve your business website's usability.
Development & Programming
Articles to help designers, developers and programmers create successful, search engine friendly ecommerce websites and improve existing ones.
Hosting, Infrastructure & Software
Articles for ecommerce businesses about ecommerce web hosting, business infrastructure, business strategy and helpful ecommerce & small business software.
Interviews & Profiles
Interviews with prominent ecommerce business personalities and profiles of successful online businesses.
Inventory & Shipping
Ecommerce articles about inventory management, ecommerce order fulfillment and product shipping considerations.
Marketing & Revenue Growth
Articles relating to online marketing, email marketing and using the Internet to growing your business.
Search Engine Optimization
Search engine optimization articles for ecommerce business owners, strategists, marketers and developers.
Shopping Carts & Online Payments
Articles covering ecommerce shopping cart platforms and options for choosing an online payment gateway.
Training & Education
Tutorials and articles providing training and education for ecommerce business owners and developers of ecommerce websites.

Search Articles

Ecommerce Community

Ecommerce Blogs
Read our blogs about ecommerce topics written by industry professionals.
Community Forum
Connect with other ecommerce professionals to trade advice and answers in our community forum.
Podcasts
Check out our ecommerce podcasts covering topics ranging from interviews to tutorials.
RSS Content Feeds
Subscribe to our RSS feeds and have fresh ecommerce content delivered to you.

Ecommerce Resources

Free Email Newsletter
Sign up for Ecommerce Notes, our free email newsletter for ecommerce business owners and developers.
Ecommerce Directory
Browse our directory of ecommerce products and services, or submit your own listing in our directory.
Ecommerce Glossary
Familiarize yourself with terminology or submit terms to help others with our Ecommerce Glossary.
Events Calendar
Find out about upcoming ecommerce events or invite other ecommerce professionals by posting your own event.
Press Releases
Browse ecommerce related press releases and post your own press release for distribution.
Ecommerce Store & Back Issues
Pick up back issues of Practical eCommerce magazine along with other merchandise from Practical Ecommerce

About Practical eCommerce

Frequently Asked Questions
Look at frequently asked questions regarded using our website, subscribing to our magazine and more.
Advertising Information
Information about advertising in Practical eCommerce magazine, on our website, or in our email newsletters.
Editorial Sharing
Learn about options for sharing our content with your visitors, customers or employees.
About Us
Learn more about Practical Ecommerce magazine and meet our staff.
Contact Us
Contact Practical Ecommerce at any time for more information. We'd love to hear from you.
AdvertisementBDXIArial SoftwareMarketplace Earth

Copyright 2007 Confluence Distribution, Inc. and Practical eCommerce.
All Rights Reserved.

Privacy PolicyConditions of UseWebsite MapContact Us