Enjoy an ad free experience by logging in. Not a member yet?
Register .
02-18-2009, 07:25 PM
PM User |
#1
New to the CF scene
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
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!
02-19-2009, 07:39 AM
PM User |
#2
Supreme Master coder!
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
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)
Users who have thanked abduraooft for this post:
02-19-2009, 09:16 AM
PM User |
#3
New to the CF scene
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
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
02-19-2009, 09:32 AM
PM User |
#4
Supreme Master coder!
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
Users who have thanked abduraooft for this post:
02-19-2009, 10:06 AM
PM User |
#5
New to the CF scene
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by
abduraooft
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?
02-19-2009, 11:27 AM
PM User |
#6
Supreme Master coder!
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
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)
02-19-2009, 11:37 AM
PM User |
#7
New to the CF scene
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
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.
02-19-2009, 11:41 AM
PM User |
#8
New to the CF scene
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
when I inspect the contents of subid using
i get a blank alert box. is there anyway to see the value being assigned to this.parentNode.className.split("_"); ?
02-19-2009, 12:17 PM
PM User |
#9
Supreme Master coder!
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
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)
Users who have thanked abduraooft for this post:
02-19-2009, 12:31 PM
PM User |
#10
New to the CF scene
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
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
02-19-2009, 01:25 PM
PM User |
#11
Supreme Master coder!
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
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)
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
Users who have thanked abduraooft for this post:
02-19-2009, 01:32 PM
PM User |
#12
New to the CF scene
Join Date: Feb 2009
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
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 ..
Jump To Top of Thread
Thread Tools
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
HTML code is Off
All times are GMT +1. The time now is 09:30 PM .
Advertisement
Log in to turn off these ads.