I have seen similar questions like this asked but it seems none of the solutions I've seen and tried work.
I have a People Picker control that sets calculated values for User ID, Email, and Phone.
All I want to do is have text box controls contain the values from the calculated fields. So like when you select a user in the people picker, a text box would have the value for Email or Phone.
I have tried using javascript but the change() method does not seem to work for the calculated value or the people picker control. I know the java script works because if I arbitrarily fire a change() method on a different control like a dropdown then it will write the Email from the calculated value into my text box but that's not the functionality I need. I need the value to be written to the text box once the person is selected in the people picker and I have not seen a solution yet that works.
Solved! Go to Solution.
you can do it eg. following way
- update formula in calc value control to something like: <Exististing formula> + UpdateTextBox()
- define javascript function like
function UpdateTextBox(){
NWF$('#'+TextBox).val('Email');
return "";
}
Thank you. This worked perfectly.
Hi Marian,
I would like to use this example, but when I tried it didn't work for me. I have obviously misunderstood something.
Have I missed a step?
Thank you,
Christina.
above script was just an example how to 'simulate' resp. capture calculated control change event. and it just set "Email" string to text box.
if you want to set text box value to a value of calculated control control itsef use something like following
UpdateTextBox(<Existing formula>)
function UpdateTextBox(inpval){
NWF$('#'+TextBox).val(inpval);
return inpval;
}
Thanks, Marian. Forgive me, but this is really new to me and I'm unsure how to make this work.
So far I have added the first line to the calculated field so that it now reads:
I then copied the second part into the form settings. I'm presuming I change the '#' for the name of the text field that I want to copy the calculated value in to, i.e.:
function UpdateTextBox(inpval){
NWF$('RiskRankingHSEScore'+TextBox).val(inpval);
return inpval;
}
Is this all correct?
THANK YOU!
everything is correct except of
NWF$('RiskRankingHSEScore'+TextBox).val(inpval);
it should have been
NWF$('#' + RiskRankingHSEScore).val(inpval);
where RiskRankingHSEScore is javascript variable configured for text control, not its name.
if that still doesn't work or anything is still not clear I would suggest to start new question so that this thread doesn't confusing dealing with several different problems.
Hello Marian, Can you check out my question on this configuration at: https://community.nintex.com/thread/18088-read-in-text-from-list-item-and-place-it-in-form-text-box
Thanks
checked