cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get textbox value in Display mode of the form?

Jump to solution

Hi,

I have a Nintex Office 365 form. I have written javascript to print the form. There are many textboxes on the form which are not connected to any column of content type. How can I get values of these textboxes in Display mode of the form?

I have written following code which returns 'undefined'

var res = NWF$("#" + txtRes).val();

This works & gives proper value in New & Edit mode of form but not in Display mode.

Labels: (1)
0 Kudos
Reply
6 Replies
Workflow Hero

Re: How to get textbox value in Display mode of the form?

Jump to solution

Hi,

do you try this ?

var res = NWF$("#" + txtRes).text();

As you are in display mode, your field is not represent by an input control but by a div

Regards,

0 Kudos
Reply
Not applicable

Re: How to get textbox value in Display mode of the form?

Jump to solution

Thanks for reply Jean. I tried what you have said but NWF$("#" + txtRes).text() returns blank string. And it has value which is displayed on form.

When I see page source in developers tool of browser, there is div with value & hidden textbox but the textbox has assigned different id & when tried to check output of NWF$("#" + txtRes) in quick Watch, it returns control with selector having different id.

0 Kudos
Reply
Workflow Hero

Re: How to get textbox value in Display mode of the form?

Jump to solution

You're right, I just have a try and reproduce the same issue, but i find a way to achieve it.

You can set the css class field on your text control like this :

Sans titre.png

Choose the name you want for css class

And after your javascript will be like this :

NWF$(".test input").val();

Works for me in every mode

Reply
Not applicable

Re: How to get textbox value in Display mode of the form?

Jump to solution

Thanks a lot Jean. It's working. You saved my day

Reply
Not applicable

Re: How to get textbox value in Display mode of the form?

Jump to solution

Ahah I had the exact same problem than Chitra and your solution helped me, so i thank you too

Reply
Not applicable

Re: How to get textbox value in Display mode of the form?

Jump to solution

Thanks for selecting a "correct answer!" So helpful for others!

Reply