How to incremen the html attribute class using jquery

  • # January 10, 2013 at 4:04 am

    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 this

    var v = jQuery(“#frmSovMca”).validate({
    errorLabelContainer: $(“div.msg-error2”),

    submitHandler: function(form) {
    success: function(response) {

    obj = jQuery.parseJSON(response);

    if (obj.status == ‘< ?php echo OBJECT_STATUS_SUCCESS; ?>‘) {

    Mca Added/Updated Successfully

    setTimeout(“$(‘#result3’).html(”)”, 2000);
    // $(“td.addmca2″+vCounter).html(obj.message);
    vcounter=< ?php $_SESSION; ?>+””;






    } else{


    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);


    $vGrandTotal = fGetGrandTotal($_SESSION);
    $vPercentage = fGetPercentage($vGrandTotal);
    $aSovMca = $vPercentage;
    $aSovMca = $vGrandTotal;

    echo json_encode($aSovMca);

    function fGetScheduleX($aSovMca) {

    $vList = ‘


    foreach ($aSovMca as $thisVal)
    $vList .= ‘


    $vList .= ‘

    MCA No. MCA Title Source Quote (CAD) Your Quote(CAD)
    ‘ . $thisVal . ‘ ‘ . $thisVal . ‘ ‘ . $thisVal . ‘ Edit | Remove


    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

    # January 10, 2013 at 4:15 am

    Your code above is all messy the way you inputted it.

    Please create a [Codepen]( for us to be able to have a look at everything in a clean environment.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.