Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-18-2009, 07:25 PM   PM User | #1
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
Radio Button Click Does Not Update Text in IE

http://globalconsultancy.net/Kinetic...ine_id=1&sku=1

if this is viewed in Firefox or Safari, when a user selects between different processors the price and 'included in cost' tag is automatically appended to the each of each one.

however, viewed in IE it does the opposite. for an example, change processors three times.

i'm at a loss as to how to fix this and numerous hours of sleep have been lost. please help!
kitsch is offline   Reply With Quote
Old 02-19-2009, 07:39 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
IE gives and error, when the execution reaches
Code:
var subid = this.parentNode.getAttribute('for').split("_");
Quote:
... is null or not an object
Anyway, it's always a good practice to rectify all errors in the markup, when using complex javascript operations.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
kitsch (02-19-2009)
Old 02-19-2009, 09:16 AM   PM User | #3
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
hi there,

yep, I found the error myself and have been tryingto replace with

Code:
document.getElementById
but that doesn't seem to work. I need something that cab read the value of the 'for' attribute of a label (look at the markup for processors).

any ideas are much appreciated
kitsch is offline   Reply With Quote
Old 02-19-2009, 09:32 AM   PM User | #4
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Have a look at http://www.quirksmode.org/bugreports...urns_null.html
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
kitsch (02-19-2009)
Old 02-19-2009, 10:06 AM   PM User | #5
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
the link that page mentions as an example, doesn't work. and apparently Safari won't support attributes["for"].value

htmlFor will work according to the quotes mentioned, but i'm not sure how best to implement it?
kitsch is offline   Reply With Quote
Old 02-19-2009, 11:27 AM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
I know it's not the correct solution, though how about
Code:
<label for="processor_10" class="processor_10">.....
and
Code:
var subid = this.parentNode.className.split("_");
?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 02-19-2009, 11:37 AM   PM User | #7
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
i was thinking that, but couldn't quite figure out how to access the class. the class name and for attribute will always marry up though.

when I try this, it then throws an error

Code:
Line:  83
Char: 4
Error: 'PRICE(...)' is null or not an object.
Code: 0
i'm just working through PRICE now to see if there's maybe an error in the parameters.
kitsch is offline   Reply With Quote
Old 02-19-2009, 11:41 AM   PM User | #8
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
when I inspect the contents of subid using

Code:
alert(subid)
i get a blank alert box. is there anyway to see the value being assigned to this.parentNode.className.split("_"); ?
kitsch is offline   Reply With Quote
Old 02-19-2009, 12:17 PM   PM User | #9
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
It worked(got the correct alerts) for me for
Code:
var subid = this.parentNode.className.split("_");
			alert(subid);
and
Code:
<p><input name="processor" value="2" id="processor_10" type="radio">
<label for="processor_10" class="processor_10">Intel Core 2 Duo E4600<span class="price-change-box included" id="price-change-box-processor_10">[included in total cost]</span></label></p>
	<p><input name="processor" value="3" id="processor_11" type="radio">
<label for="processor_11" class="processor_11">Intel Core 2 Duo E7300<span class="price-change-box adjust" id="price-change-box-processor_11">[ $3]</span></label></p>
	<p><input name="processor" value="4" id="processor_12" checked="checked" type="radio">
<label for="processor_12" class="processor_12">Intel Core 2 Duo E4700<span class="price-change-box adjust" id="price-change-box-processor_12">[ $25]</span></label></p>
	<p><input name="processor" value="6" id="processor_13" type="radio">
<label for="processor_13" class="processor_13">Intel Core 2 Duo E8200<span class="price-change-box adjust" id="price-change-box-processor_13">[ $44]</span></label></p>
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
kitsch (02-19-2009)
Old 02-19-2009, 12:31 PM   PM User | #10
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
if you could have a look at the code here:

http://kineticuk.com/Pilot/customisa...d=1&promo_id=1

you'll see it throws an error straight away. something to do with the PRICE object, similiar to the piece of code I posted earlier

i've made all the changes you suggested. any ideas why this isn't working here?


thanks again
kitsch is offline   Reply With Quote
Old 02-19-2009, 01:25 PM   PM User | #11
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
I haven't checked the working/logic of your script/page, but here is a copy of your page at my end (saved from browser's Ctrl+S option)

(see the attached zip)
Attached Files
File Type: zip customisation_files.zip (26.7 KB, 73 views)
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Users who have thanked abduraooft for this post:
kitsch (02-19-2009)
Old 02-19-2009, 01:32 PM   PM User | #12
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
thanks.

i've uploaded it to my server but, surprise surprise, it still doesn't work. ( http://kineticuk.com/Pilot/customisa...d=1&promo_id=1 )
the text for processors and ram etc, isn't being generated. you'll notice it also doesn't work correctly in FF now. sorry for all this hassle but you've been a big help so far & i think it's nearly fixed!

Last edited by kitsch; 02-19-2009 at 01:41 PM..
kitsch is offline   Reply With Quote
Old 02-19-2009, 01:57 PM   PM User | #13
kitsch
New to the CF scene

 
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
kitsch is an unknown quantity at this point
if it helps you can view an alternative design here:

http://alienware.co.uk/configurator_...de=SKU-DEFAULT
kitsch is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:30 PM.


Advertisement
Log in to turn off these ads.