I've a peice of code that is working fine for me in FF but errors out
in IE 6 and 7.
I'm using the impromptu and corner plugins, although I don't think the
error is related to them.


<script type="text/javascript">
                                        availpoints = 500;
                                        $(document).ready(function() {
                                                if ( $('.spendlogo').length ){
                                                        
$('.spendlogo').click(function(){
                                                                reward = 
Number($(this).attr('reward'));
                                                                redeemtxt = 
'How many points would you like to redeem?<br /
>You can redeem a maximum of '+availpoints+' points<input
type="hidden" name="rewardid" id="rewardid" value="'+reward+'" /
><input type="text" name="qty" id="qty" /><span id="feedback"></
span>';
                                                                
$.prompt(redeemtxt,{
                                                                                
 submit: rewardme,
                                                                                
 buttons: {Redeem:'Redeem', cancel:'cancel'}
                                                                                
 }).corner();
                                                        });
                                                }
                                        });


                                        function rewardme(button, message){
                                                if(button == 'Redeem'){
                                                        inp = 
message.children('#qty');
                                                        feedback = 
message.children('#feedback');
                                                        reward = 
message.children('#rewardid').val();
                                                        qty = 
message.children('#qty').val();
                                                        if(qty > availpoints){
                                                                
inp.css("border","solid #ff0000 1px");
                                                                
feedback.html('<br />You do not have enough points.');
                                                                return false;
                                                        } else if(qty%5 > 0){
                                                                
inp.css("border","solid #ff0000 1px");
                                                                
feedback.html('<br />Please enter a multiple of 5');
                                                                return false;
                                                        } else {
                                                                
$('#reward').val(reward);
                                                                
$('#points').val(qty);
                                                                
$('#spend').submit();
                                                                return true;
                                                        }
                                                } else {
                                                        return true;
                                                }
                                        }
                                </script>


In IE the line

feedback = message.children('#feedback');

throws a "Object doesn't support this property or method".

I'm fairly new to JQuery and I'm stumped as to why this selector
fails.

I've tried adding a name="feedback" attribute to the span.
I've tried changing the variable name from feedback to something else
in case that was a conflict.
I even tried swapping the 4 lines with .children() in around to check
if maybe I needed to reset the message object before I could
call .children() again but it's only that one line that errors, and
it's position seems irrelevant.

I'm sure it's somethign really simple but I don't know what it is and
help would be appreciated.

Reply via email to