Xtremer360 Posted May 28, 2011 Share Posted May 28, 2011 I'm trying to figure out what i'm doing wrong here. It should be showing a list of values for each match with an object property of titles_id_list and its giving me an error of "reference to undefined property "titles_id_list". This error only occurs when I submit my form. // Add the matches for( var match_number = 0; match_number < <?php echo $number_of_matches ?>; match_number++ ) { var li_titles = $('ul#titles_defended'+ match_number +' li'); var titles_id_list = ""; var j = 0; $('ul#titles_defended'+ match_number +' li').each(function(){ var li_title = $( li_titles[ j ] ); // only start appending commas in after the first characterID if( j > 0 ) { titles_id_ist += ","; } // append the current li element's characterID to the list titles_id_list += li_title.attr( 'title_id' ); j++; }); var itemObj = new Object(); itemObj.type = "Match"; itemObj.description = "Match #" + (i+1); itemObj.match_type_id = $('select#match_type_drop'+ (i+1)).val(); itemObj.titles_id_list = titles_id_list; eventItems.push( itemObj ); } Quote Link to comment https://forums.phpfreaks.com/topic/237727-reference-to-uknown-object-property/ Share on other sites More sharing options...
seanlim Posted May 29, 2011 Share Posted May 29, 2011 if( j > 0 ) { titles_id_ist += ","; } should that be titles_id_list? Quote Link to comment https://forums.phpfreaks.com/topic/237727-reference-to-uknown-object-property/#findComment-1221818 Share on other sites More sharing options...
Xtremer360 Posted May 29, 2011 Author Share Posted May 29, 2011 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/237727-reference-to-uknown-object-property/#findComment-1221908 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.