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: 2Questions: 1Answers: 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: 56,837Questions: 1Answers: 9,035 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.