nikzz
1
I am able to get field’s value using
$("select/input/textarea[data-fieldname='fieldname']").val();
But I’m having issue when fetching a read-only field. Its giving underfined.
But when I’m using
$("[data-fieldname='fieldname']").text();
Its giving the value but with other parameters/ spaces too.
Can anyone tell me how to get the value of readonly field using .val (jquery)
PS–> I tried using readonly/readOnly/read-only/input[readonly] but none of them worked
lokesh
2
did you try this?
var val = cur_frm.doc.fieldname;
alert(val);
nikzz
3
already achieved…thanks btw
if you are using in doc
$(“[data-fieldname=‘workflow_stage’]”)[0].fieldobj.value

nikzz
5
this didn’t worked but giving error @AkshayJadhao
where are you using on form or in page?

this worked for me
$(this)[0].cur_frm.fields_dict.workflow_stage.value
workflow_stage= your field name
can you try this ?

nikzz
9
Yeah it is working the way you said (in console) but my aim was to access it via custom script. On using this through custom script, its giving error