Unable to get value of readonly field

I am able to get field’s value using


But I’m having issue when fetching a read-only field. Its giving underfined.

But when I’m using


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

did you try this?
var val = cur_frm.doc.fieldname;

already achieved…thanks btw

if you are using in doc



this didn’t worked but giving error @AkshayJadhao

where are you using on form or in page?

Trying at form


this worked for me


workflow_stage= your field name

can you try this ?


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