Skip to main content

I have a textbox with Client ID JavaScript variable name set to 'UserMnemonicId'

On form load i call javasrcipt function and display alert .

NWF$(document).ready(function(){
alert('test function');
alert(NWF$('#UserMnemonicId').val());
});

I get both the alerts but for the second alert it displays 'undefined'

Don't know why the textbox value is displayed as 'undefned'

Is there anything that i am doing wrong or missing?

you've used wrong syntax, try following

alert(NWF$('#' + UserMnemonicId).val());


Converted  discussion to question


Thanks Marian, it worked


What Am I Missing? 

I get an alert w/ 'abc1' and then an alert w/ 'undefined' and then 'abc2'. 

Am I missing a directive or setting in Nintex get this to work?

function showPassword(){

var displayWindowsUserName = 'abc1';

alert(displayWindowsUserName );

displayWindowsUserName = NWF$('#' + jsWindowsUserName);

alert(displayWindowsUserName.val());

alert('abc2');

}

219526_pastedImage_1.png

Thank You!


I think the  NWF$ is not defined?
I am new to JS myself ....

NWF$(document).ready(function(){

....

.........

});

More info: https://community.nintex.com/docs/DOC-6783-simple-javascript-concepts-in-nintex-form


With no changes, I was able to see the value in Edit Mode.  That's all I require at this point, but I do wonder if there's a way to view the field values in Display Mode.


in Display mode javascript variables are not instantiated, so to get control's value you need a different way how to identify a control you want to get a value from.

typically it's done by a defining a custom CSS class and then use it as a control's selector.


Hi @bbollmann,


 


Can you explain the experience you are wanting with your JavaScript? What could we build in product so you didnt need to use this JavaScript? 



Are you wanting a modal popup triggered from a rule?


 


Cheers,


Euan


Reply