and print the values ​​of a query in standalone mode

and print the values ​​of a query in standalone mode

rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2
edited January 2015 in Editor

and print the value of a query on labels

 <dt data-editor-label="TXT_ETIQUETA"></dt>
 <dd data-editor-field="TXT_ETIQUETA"></dd>

commonly do something like this, to pass the value to the html tags.

url: 'include/implentacion_persona2.php?var1='+id_campo, 
type: "POST", 
data: query, 
dataType: 'json', 
success: function (data) { 
    var obj = data; 
    for (var i = 0, o = obj.data, l = o.length; i < l; i++)
    { 
        alert( 'IDASEGURADORA = ' + o[i].ID_ASEGURADORA + '   IDCAMPO = ' + o[i].ID_CAMPO +  ' ETIQUETA = ' + o[i].TXT_ETIQUETA  ); 
        $("#id").val(o[i].ID_ASEGURADORA);
        $("#nombre").val(o[i].ID_CAMPO);
        $("#id2").val(o[i].TXT_ETIQUETA);

I have not been able to realize send data in this way, I can help you achieve this.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Is the Javascript above part of your Editor ajax option? You can't use success as noted in the ajax documentation as Editor will override it.

    I'm afraid I don't fully understand what you are asking. Do you want to write values to the HTML? It looks like you already are on lines 10-12.

    Allan

  • rrzavaletarrzavaleta Posts: 78Questions: 52Answers: 2

    I want to do is pass the values ​​of a variable tag

    <dt id ="id"data-editor-label="TXT_ETIQUETA"></dt>

    I commonly do this

    $("#id").val(o[i].ID_ASEGURADORA);

    but I can not pass the value .

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Use $().html() rather than $().val() if you want to write to the HTML.

    Allan

This discussion has been closed.