cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
themos
Nintex Newbie

jQuery in View item mode

Jump to solution

Did anyone notice this?

If you try to access a form variable via jQuery when the form is opened in View mode, it comes back as undefined!

e.g. alert(NWF$('#' + txtSignature).val());

even though the variable has a value (works correctly in edit mode), and that value is displayed correctly as a form field in View mode?!

I tried executing the jQuery command in NWF$(document).ready, in NWF.FormFiller.Events.RegisterAfterReady, and even by itself, with the same results...

Tags (2)
Reply
11 Replies
Automation Master
Automation Master

Re: jQuery in View item mode

Jump to solution

Hello Themos K​ – I just took a look expecting a fairly easy workaround, but am seeing the same behavior. I also tried using the CSS class to get the field's value and didn't have any luck there either.

In fact it looks like the CSS class isn't even being applied to the control (so perhaps the same is occurring for the JavaScript client ID variable).

0 Kudos
Reply
themos
Nintex Newbie

Re: jQuery in View item mode

Jump to solution

As this is not expected behavior, could it be a Nintex Forms bug?

0 Kudos
Reply
Automation Master
Automation Master

Re: jQuery in View item mode

Jump to solution

Perhaps. I was expecting to be able to query a control's value via it's CSS class or assigned JavaScript client ID variable regardless of mode.

Anyone else have experience on this issue? I'll make sure to bookmark this thread so I can catch any feedback.

0 Kudos
Reply
mlauer
Nintex Newbie

Re: jQuery in View item mode

Jump to solution

Hi Themos,

it looks like Client ID JavaScript variable is accessible by JavaScript but ID is not part of html in view mode. Also Control CSS class is not part of html but CSS class.

To get text of e.g. a single line control give it a CSS class, e.g. cctest in formatting section of control settings.

To get value of control use:

NWF$('.cctest').text()

Kind regards

Manfred

View solution in original post

Reply
themos
Nintex Newbie

Re: jQuery in View item mode

Jump to solution

It worked, thanks!

0 Kudos
Reply
leif_frederikse
Nintex Newbie

Re: jQuery in View item mode

Jump to solution

I have just filed this as a bug with the following description:

---------------------------------------------------------

1) I create a new custom list. Just the default stuff - no changes to it.
2) I create an item in the list and put in "Testing this" in the title field.
3) I open the Nintex Form Designer and assign a Client ID JavaScript variable to the title field. I call it varTitle.
4) Under Settings->Custom JavaScript I put in the following:
NWF$(document).ready(function(){
   var fldTitle = NWF$("#" + varTitle); 
   alert("Title is: " + fldTitle.val());
})
5) I go back to my list and open the item I created in step 2 in edit mode. This gives me an alert box saying "Title is: Testing this".
6) I go back to my list and open the same item in view mode. This gives me an alert box saying "Title is: undefined"

Step number 6 shows the error - it should give the same result as step 5.

I consider this a bug - do you agree?

---------------------------------------------------------

I will let you know what Nintex responds. I hope it will be recognized as a bug and fixed.

Regards

Leif

Reply
themos
Nintex Newbie

Re: jQuery in View item mode

Jump to solution

That's perfect, thanks Leif!

0 Kudos
Reply
leif_frederikse
Nintex Newbie

Re: jQuery in View item mode

Jump to solution

Just got this back from Nintex support:

--------------------------------------

Hi Leif

Thank you for contacting Nintex Support.

I've confirmed this issue in our environment.

We will raised the issue to Development team and will get back to you as soon as I heard from them.

I thank you for your understand with this matter and please do not hesitate to contact us if you need further information.

------------------------------------------

I am very happy with the reaction speed from Nintex Support - quite impressive so far

Regards

Leif

Reply
Automation Master
Automation Master

Re: jQuery in View item mode

Jump to solution

very nice – thanks for following up Leif Frederiksen​!

0 Kudos
Reply