Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to incremen the html attribute class using jquery

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #41894

    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) {
    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 = ‘

    ‘;

    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 [email protected]

    #120498
    Andy Howells
    Participant

    Your 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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.