Anyone have any clues on this?

On Apr 16, 11:32 am, Dayjo <dayjoas...@gmail.com> wrote:
> Hey,
>
> I'm receiving the following error:
> Error: uncaught exception: Syntax error, unrecognized expression: #
>
> However all the functionality of the script continues to work, I need
> to get rid of the error as it looks pretty bad on client's sites and
> want to make sure the script isnt doing anything funny.
>
> The basic set up is a number of Select boxes, When selecting an option
> in the select boxes, I loop through a JSON stock array to see if the
> item is in stock and to then enable / disable the relevant options in
> the other selects based on the stock record.
>
> The error (as far as I can see) appears on this line:
>  $("#option" + nextid + " option").filter(function(){
>                                    return($(this).attr('id')
> ==stockitem);
>                                 }).enable();
>
> but it seems to work fine.
>
> The following script is on the change event of the selects:
>
> // Get the next Select's id
>                   var thisorder = $(this).attr('rel').substr(0,$
> (this).attr('rel').indexOf('|'));
>                   var next = $(this);
>                   $('.productOptions').find('select').each(function(){
>
>                       if( $(this).attr('rel').substr(0,$(this).attr
> ('rel').indexOf('|')) == (parseInt(thisorder) + 1)) {
>                          next = $(this);
>                       }
>
>                       if ($(this).attr('rel').substr(0,$(this).attr
> ('rel').indexOf('|')) > thisorder){
>                           $(this).disableSel();
>                           $(this).find('option:first').attr
> ('selected', 'selected').parent('select');
>                       }
>                   });
>
>                   var nextid = $(next).attr('id').replace
> ('option','');
>
>                   // If not chosen the [Choose] option..
>                   if($(this).children('[selected=true]').val()){
>
>                     // Disable all the items in the next select apart
> from [choose/none]
>                     $(next).children('option[value!=""]').disable();
>
>                         // Check each of the stock records
>                         for(i=0; i<data.stock.count; i++){
>
>                              // For each of the selects get the option
> id and item id
>                             $('.productOptions').find('select
> [disabled=false]').each(function(){
>
>                                 var optionid = $(this).attr
> ('id').replace('option','');
>                                 var itemid = $(this).children
> ('[selected=true]').attr('id');
>
>                                 curritemid = data.stock[i].items
> [optionid];
>
>                                 if(curritemid != itemid){
>                                     qty = 0;
>                                     stockitem = 0;
>                                     return false;
>                                 }else{
>                                     stockitem = data.stock[i].items
> [nextid];
>                                     qty = data.stock[i].qty;
>                                 }
>                             });
>
>                             if (stockitem!==0) {
>                                  // Enable the item based on the
> current stock record, and the next selects id
>                                 $("#option" + nextid + "
> option").filter(function(){
>                                    return($(this).attr('id')
> ==stockitem);
>                                 }).enable();
>                             }
>
>                         }
>
>                      $(next).enableSel();
>
>                  }

Reply via email to