Skip to main content

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...

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).


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


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.


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


It worked, thanks!


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


That's perfect, thanks Leif!


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 happy.png

Regards

Leif


very nice – thanks for following up Leif Frederiksen​!


Hey Leif,

Since we're on the subject of bugs, could you follow up on this one as well?

Bug in choice control rendered as button, still clickable even if disabled


Hi Themos,

I suggest that you file it as a support ticket – that’s what I did on the other subject, and that is how I can follow what’s happening and share it with you.

You can create the support ticket here: https://community.nintex.com/community/support/ask-support/overview

Regards

Leif

Fra: themos

Sendt: 20. maj 2016 13:39

Til: Leif Frederiksen <lef@m.dk>

Emne: Ang.: - jQuery in View item mode

Nintex Community <https://community.nintex.com/?et=watches.email.thread>

jQuery in View item mode

svar fra Themos K<https://community.nintex.com/people/themos?et=watches.email.thread> i Dev Talk - Se den fulde debat<https://community.nintex.com/message/40056?et=watches.email.thread#comment-40056>


Reply