labasmuse

How to change an attribute by Javascript in Single Line Textbox Control?

Discussion created by labasmuse on Apr 6, 2017
Latest reply on Apr 7, 2017 by labasmuse

In Nintex forms I would like to create a key/value relation.

By Javascript I would like to store the key (e.g. with an attribute) and try to ask for this value by an if condition. (The value is the text of the TextBox). 

Always when the key has changed (condition), then the value should Change.

 

I tried it with this JavaScript function:

function lookupInTextField (key, value,  js_Text_ID)
{
      if (NWF$('#'+ js_Text_ID).attr("placeholder") != key )
      { 
           NWF$('#'+ js_Text_ID).val(value);
           NWF$('#'+ js_Text_ID).attr("placeholder", key);
           alert ("Key-Attribute: " + NWF$('#'+ js_Text_ID).attr("placeholder"));
      }

}

 

Unfortunately the alert-Output is always "Key-Attribute: undefined". Can somebody please give me a hint what I am doing wrong. Somehow it does not work with the placeholder Attribute of the "single line TextBox" control in Nintex forms.

I Trigger this function with the "Calculated fields" control. So far so good.

 

Does anybody know how to store the key and how to get the key?

 

Any help and hints are greatly appreciated!

 

Regards

Andy

Outcomes