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

How to I get the onchange event to work?

Jump to solution

Should be pretty straight forward, but I am still having difficulties.  Basically I want to create drop down items from a list based off another drop down's selections.  I want to call the list lookup function after the value of the main drop down gets changed.   As for my problem, I am trying to implement an onchange event to my main drop down control.  When I change the drop down control, it still doesn't log anything to the console.  Even if the superVisor variable was blank, it would still log an empty value.

I made sure that in the settings for the drop down, I set the "Store Client ID in JavaScript variable" to Yes and put the name as "ddlTitle". Yet, for some reason, this still isn't working.  Am I doing the syntax right?  For regular HTML objects, this works just fine.

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

    var superVisor = NWF$('#' + ddlSuper).val();

    NWF$('#' + ddlTitle).onchange = function() {valueChanged()};

});

function valueChanged() {

  console.log(superVisor);

}

Labels: (1)
Tags (2)
Reply
5 Replies
christopheraucq
Nintex Newbie

Re: How to I get the onchange event to work?

Jump to solution

Hi Eric,

Do you know that Nintex form offers this possibility.

Please read the document from Emily Billing

Cascading drop downs and Nintex Forms for SharePoint

Best regards,

Christophe

Reply
christopheraucq
Nintex Newbie

Re: How to I get the onchange event to work?

Jump to solution

Hi Eric,

If you really need to solve your Javascript issue, please try this

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

var superVisor = NWF$('#' + ddlSuper).val();

NWF$('#'+ddlTitle).change(function() {valueChanged()});

});

Note that onchange has been changed ;-) to change

Hope this helps,

Regards,

Christophe

Reply
Not applicable

Re: How to I get the onchange event to work?

Jump to solution

Christophe,

That's weird, I tried that before and it didn't work then, but now it does.  I will also check out that document you sent me; it sounds like it will be my solution.  Thanks for your help.

0 Kudos
Reply
guyo
Nintex Newbie

Re: How to I get the onchange event to work?

Jump to solution

I'm having a similar problem and used this script as a template..  Since it's not possible to directly bind a workflow variable to the Managed Termset control, I'm trying to catch the change event on a managed termset control.  I've boiled this down  --  someMetadataJS is the javascript name of the SomeMetadata control and I can see it in declared in the form..

NWF$(document).ready(function() {
      alert("Form Ready");      
      NWF$('#' + SomeMetadataJS).change(function() {valueChanged()});
   })

function valueChanged(){    alert("Control Changed");}

The "Form Ready" triggers -- I'm stumped..

0 Kudos
Reply
reiva13
Nintex Newbie

Re: How to I get the onchange event to work?

Jump to solution

Hi Guy,

For a simple example of JavaScript, please refer to:
https://community.nintex.com/docs/DOC-6783-simple-javascript-concepts-in-nintex-form


Regards,
Reva Eka Patria

0 Kudos
Reply