[jQuery] Re: Does anyone see any problem with this code that might cause IE not to work with it?
I just wrote that piece of code to see if it would work like I was hoping it would to get and create a comma-delimited list of the same-named checkbox values. I'll move it out when I clean up the code. No ideas about the rest of the code being a problem for IE? I think I'm just going to have to break down the jquery and coldfusion to a very simple version with only one or two values to see if somehow it's the values or processing of them that's giving IE fits. Thanks for looking. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of MorningZ Sent: Sunday, September 13, 2009 5:16 PM To: jQuery (English) Subject: [jQuery] Re: Does anyone see any problem with this code that might cause IE not to work with it? i don't know about the rest of the code, but are you aware you are redefining and reattaching the plugin code "getCheckboxVals" on *each and every .live() call* ? On Sep 13, 4:08 pm, "Rick Faircloth" wrote: > There are more pieces to the code puzzle than this section, but for some > reason , once I click > > the #addButton referenced at the start of the code, IE will go all the way > down through the > > code, firing the alerts properly, until it gets to the $.ajax section. > After it gets to that point > > in the code, nothing happens. > > Now I know there could be other code involved that could be a problem, but I > just wanted > > to focus on this section for now and not ask too much of any reviewer. > > FF processes everything correctly; all alerts, ajax function, including > inserting data into the database. > > But IE just hits a wall at $.ajax. > > I've been over the code, modified the code, done everything I can think of > to get this to work, > > but can't figure out what could be the problem. > > Any ideas, anyone? Anything at all? > > Thanks for taking the time to look over this. > > Rick > > $(document).ready(function() { > > $('#addButton').live('click', function() { > > // --- [ to get multiple carStorage checkbox values ] --- // > > alert('addButton clicked'); > > jQuery.fn.getCheckboxVals = function() { > > alert('running getCheckboxVals'); > > var checkboxVals = []; > > var i = 0; > > this.each(function(i) { > > checkboxVals[i] = $(this).val(); > > }); > > var checkboxVals = checkboxVals.join(', '); > > return checkboxVals; > > } > > values = { dsn: 'mydsn', > > streetNumber: $('#streetNumber').val(), > > streetName: $('#streetName').val(), > > city: $('#city').val(), > > state: $('#state').val(), > > zipCode: $('#zipCode').val(), > > propertyType: $('#propertyType, > option:selected').val(), > > county: $('#county').val(), > > subdivision: $('#subdivision').val(), > > totalRooms: $('#totalRooms').val(), > > bedrooms: $('#bedrooms').val(), > > fullBaths: $('#fullBaths').val(), > > halfBaths: $('#halfBaths').val(), > > rent: $('#rent').val(), > > yearBuilt: $('#yearBuilt').val(), > > securityDeposit: $('#securityDeposit').val(), > > leaseTerm: $('#leaseTerm').val(), > > availabilityDate: $('#availabilityDate').val(), > > petsAllowed: > $('#petsAllowed:checked').val(), > > petDeposit: $('#petDeposit').val(), > > livingRoom: > $('#livingRoom:checked').val(), > > diningRoom: > $('#diningRoom:checked').val(), > > familyRoom: > $('#familyRoom:checked').val(), > > fireplace: > $('#fireplace:checked
[jQuery] Re: Does anyone see any problem with this code that might cause IE not to work with it?
i don't know about the rest of the code, but are you aware you are redefining and reattaching the plugin code "getCheckboxVals" on *each and every .live() call* ? On Sep 13, 4:08 pm, "Rick Faircloth" wrote: > There are more pieces to the code puzzle than this section, but for some > reason , once I click > > the #addButton referenced at the start of the code, IE will go all the way > down through the > > code, firing the alerts properly, until it gets to the $.ajax section. > After it gets to that point > > in the code, nothing happens. > > Now I know there could be other code involved that could be a problem, but I > just wanted > > to focus on this section for now and not ask too much of any reviewer. > > FF processes everything correctly; all alerts, ajax function, including > inserting data into the database. > > But IE just hits a wall at $.ajax. > > I've been over the code, modified the code, done everything I can think of > to get this to work, > > but can't figure out what could be the problem. > > Any ideas, anyone? Anything at all? > > Thanks for taking the time to look over this. > > Rick > > $(document).ready(function() { > > $('#addButton').live('click', function() { > > // --- [ to get multiple carStorage checkbox values ] --- // > > alert('addButton clicked'); > > jQuery.fn.getCheckboxVals = function() { > > alert('running getCheckboxVals'); > > var checkboxVals = []; > > var i = 0; > > this.each(function(i) { > > checkboxVals[i] = $(this).val(); > > }); > > var checkboxVals = checkboxVals.join(', '); > > return checkboxVals; > > } > > values = { dsn: 'mydsn', > > streetNumber: $('#streetNumber').val(), > > streetName: $('#streetName').val(), > > city: $('#city').val(), > > state: $('#state').val(), > > zipCode: $('#zipCode').val(), > > propertyType: $('#propertyType, > option:selected').val(), > > county: $('#county').val(), > > subdivision: $('#subdivision').val(), > > totalRooms: $('#totalRooms').val(), > > bedrooms: $('#bedrooms').val(), > > fullBaths: $('#fullBaths').val(), > > halfBaths: $('#halfBaths').val(), > > rent: $('#rent').val(), > > yearBuilt: $('#yearBuilt').val(), > > securityDeposit: $('#securityDeposit').val(), > > leaseTerm: $('#leaseTerm').val(), > > availabilityDate: $('#availabilityDate').val(), > > petsAllowed: > $('#petsAllowed:checked').val(), > > petDeposit: $('#petDeposit').val(), > > livingRoom: > $('#livingRoom:checked').val(), > > diningRoom: > $('#diningRoom:checked').val(), > > familyRoom: > $('#familyRoom:checked').val(), > > fireplace: > $('#fireplace:checked').val(), > > appliances: $('#appliances').val(), > > waterIncluded: > $('#waterIncluded:checked').val(), > > fence: $('#fence:checked').val(), > > fenceDescription: > $('input:checkbox[name=fenceDescription]:checked').getCheckboxVals(), > > carStorage: > $('input:checkbox[name=carStorage]:checked').getCheckboxVals(), > > utilities: $('#utilities, > option:selected').val(), > > alarmSystem: > $('#alarmSystem:checked').val(), > > washerDryerIncluded: > $('#washerDryerIncluded:checked').val(), > > washerDryerHookups: > $('#washerDryerHookups:checked').val(), > > storage: $('#storage:checked').val(), > > other: $('#other').val(), > > available: > $('#available:checked').val(), > > //softDelete: > $('#softDelete:checked').val(), > > remarks: $('#remarks').val() > > } > > alert( $('#remarks').val() ); > > $.ajax ({ cache: false, > > type: 'post', > > url: > 'rentalProperties.cfc?method=mAddRentalProp