- This topic is empty.
-
AuthorPosts
-
January 10, 2013 at 4:04 am #41894ignitious_phpMember
in Zoho Support » Using Zoho Support • 22 hours ago
How to increment the html attribute class using jquery. i am actually working on a php/ajax data grid. it works on tables and dynamically i am loading rows result from the database. After the user has added rows with results in one table, the user can add new heading and add new rows in new tables. I am using the following code to do thisvar v = jQuery(“#frmSovMca”).validate({
errorLabelContainer: $(“div.msg-error2”),submitHandler: function(form) {
jQuery(form).ajaxSubmit({
success: function(response) {obj = jQuery.parseJSON(response);
if (obj.status == ‘‘) {
$(‘#result3’).html(‘Mca Added/Updated Successfully‘);
setTimeout(“$(‘#result3’).html(”)”, 2000);
// $(“td.addmca2″+vCounter).html(obj.message);
vcounter=+””;if(obj.title==vcounter){
$(“td.addmca2”).append(obj.message);$(“#Gtotal”).html(obj.GrandTotal);
$(“#Percentage”).html(obj.Percentage);}else{
$(“td.addmca2”).html(obj.message);$(“#Gtotal”).html(obj.GrandTotal);
$(“#Percentage”).html(obj.Percentage);}
} else{
$(‘div.msg-error2’).html(‘‘+obj.error+’‘);
setTimeout(“$(‘div.msg-error2’).html(”)”, 2000);
}},
clearForm: false,
resetForm: false
});
}
});
});
but i cant get the counter variable incremented from php , i need to use it for incrementing the class attribute to insert the new result in new row with the class incremented.the php code is here
$aSovMca = fGetSovMca($vSubID, $sovID, 0, $_SESSION);
$aSovMca = fGetScheduleX($aSovMca);
$aSovMca = OBJECT_STATUS_SUCCESS;
$vGrandTotal = fGetGrandTotal($_SESSION);
$vPercentage = fGetPercentage($vGrandTotal);
$aSovMca = $vPercentage;
$aSovMca = $vGrandTotal;echo json_encode($aSovMca);
function fGetScheduleX($aSovMca) {
$vList = ‘
‘ . $aSovMca[0] . ‘ Edit MCA No. MCA Title Source Quote (CAD) Your Quote(CAD) ‘;
foreach ($aSovMca as $thisVal)
$vList .= ‘‘ . $thisVal . ‘ ‘ . $thisVal . ‘ ‘ . $thisVal . ‘ Edit | Remove ‘;
$vList .= ‘
‘;
return $vList;
}this is the html table in which i am appending the db result
please help me how can i get the soulution out of it
please email me the answer at [email protected]January 10, 2013 at 4:15 am #120498Andy HowellsParticipantYour code above is all messy the way you inputted it.
Please create a [Codepen](http://codepen.io) for us to be able to have a look at everything in a clean environment.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.