Hello,
using for each of jquery am fetching td's name
but if try to test it by removing name from firbug and try to submit it then my code is breking.
so first question, what should anyone do in such case?
and another regarding my code is:
$('#SkillDetails_table tr').each(function()
{
var temp_tr_id = $(this).attr('id');
if(temp_tr_id)
{
if(temp_tr_id.indexOf('skillDetails') !== -1)
{
var Splitted_String = temp_tr_id.split('-');
var validation_index=Splitted_String[1];
if(validation_index)
{
var Splitted_String = temp_tr_id.split('-');
var TR_ID=Splitted_String[1];
// fetch values from page
// HERE WHAT IF I DO NOT GET $("input[name='skillDetails[" + TR_ID + "]['skillType']']" )
// i.e. user has deleted it from firebug
var SKILL_TYPE_NAME=$("input[name='skillDetails[" + TR_ID + "]['skillType']']" ).val().trim();
var SKILL_NAME=$("input[name='skillDetails[" + TR_ID + "]['skill']']" ).val().trim();
var PROF_LEVEL_VALUE=$('#prof_level-'+TR_ID).val().trim();
var EXP_YEARS_VALUE=$('#exp_year-'+TR_ID).val().trim();
var EXP_MONTHS_VALUE=$('#exp_months-'+TR_ID).val().trim();
var LAST_USED_VALUE=$('#last_used_year-'+TR_ID).val().trim();
var DESCIPTION_VALUE=$('#description-'+TR_ID).val().trim();
// here i want soming like if loop that,if i did not get required values then do not go to ajax call.
// save values to database using ajax call
$.ajax({
});
}
else{alert("no tr id got here");}
}
else{//return false;
}
}
else
{}
});
if(save_value==true)
alert("Your data has been saved in draft status.");
else
alert("NOT SAVED DATA INTO DRFAT");
}
I know code is very worst,
but suggestions are welcome.