Wrox Programmer Forums
|
BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143
This is the forum to discuss the Wrox book Beginning PHP 6, Apache, MySQL 6 Web Development by Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz; ISBN: 9780470391143
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2010, 10:18 AM
Authorized User
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15 ecomm_checkout.php javascript not working

Has anyone else noticed that the javascript in ecomm_checkout.php (page 530) doesn't seem to be working. If you uncheck the checkbox for Shipping Information is same as billing, you should be able to see the table to enter the shipping information. This is not happening. I tried downloading the code from the Wrox site, and theirs doesn't work either. I am not an expert on JavaScript, but I do know a little bit about it and I can't see anything wrong with the script. If anyone has managed to get this to work properly, would you please let us know how you did it?
Thanks.
 
Old August 5th, 2010, 08:50 AM
Authorized User
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Fix for javascript not working in Chapter 15 ecomm_checkout.php

I found a script on the internet to toggle visibility based on a checkbox and modified it so that it works with this exercise. When the page loads, both tables will be visible. If the user checks, the box "shipping info is same as billing", the second table will no longer be visible on the page.
Here is the script:
<script type="text/javascript">
function toggleCheckbox(checkboxName, shippingTable) {
var t = document.getElementById(shippingTable);
var checkbox = document.getElementById(checkboxName);
if (checkbox.checked == true) {
t.style.display = 'none';
} else {
t.style.display = 'block';
}
}
</script>

You will also need to change the line where you create the checkbox so that it looks like this:
<input type = "checkbox" id = "same_info" name = "same_info" onClick="toggleCheckbox(this.name,'shipping_table' );" ;"/>

Now you will have a Checkout Part 1 page that actually works the way it is supposed to.
 
Old October 31st, 2010, 09:37 PM
Authorized User
 
Join Date: Sep 2010
Posts: 20
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Did you have the images for this chapter? None of the files I've downloaded seem to have them.
 
Old November 1st, 2010, 08:14 AM
Authorized User
 
Join Date: Apr 2010
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, I couldn't find the images for this exercise either. What I ended up doing was pulling some pictures off of the internet and resizing them, and substituting them for the ones in the exercise.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch.15 transact_user.php/Change my info not working djlfreak BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 2 May 12th, 2010 01:42 PM
Ch.15 transact_user.php/Change my info not working djlfreak BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 May 11th, 2010 12:32 PM
PHP 4 chapter 15 angelic_scars BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 November 29th, 2006 08:36 AM
chapter 15 cart.php pink BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 July 18th, 2005 05:45 PM
chapter 15 adv_mail.php ncliche BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 January 14th, 2004 03:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.