how to get hidden field value, i have to pass in ajax data option

how to get hidden field value, i have to pass in ajax data option

naveensargamnaveensargam Posts: 3Questions: 2Answers: 0

ajax: {
url:"{{ url('activity:qset_qsetblng') }}",
data:function(d){
var selected = parentTable.row( { selected: true } )
if ( selected.any() ) {
d.parent_id = selected.data().id;
d.csrfmiddlewaretoken = '{{ csrf_token }}'
d.question = true
d.alerton = JSON.stringify($("#DTE_Field_alerton").val())
d.question_id = $("#DTE_Field_question").val()
d.min = $("#DTE_Field_min").val()
d.max = $("#DTE_Field_max").val()
d.alertbelow = $("#DTE_Field_alertbelow").val()
d.alertabove = $("#DTE_Field_alertabove").val()
d.answertype = $("#DTE_Field_answertype").val()
d.seqno = $("#DTE_Field_seqno").val()
d.ismandatory = $("#DTE_Field_ismandatory").val()
d.options = $("#DTE_Field_options").val()
d.id = $("#DTE_Field_pk").val() //giving undefined here
d.ctzoffset = $("#id_ctzoffset").val()
}
}
},

Replies

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

    This is from an Editor form? I'd suggest using the Editor API for this - field().val(). E.g.:

    editor.field('pk').val();
    

    Allan

Sign In or Register to comment.