Nintex for SharePoint Forum
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
I've got a calculated field with a value that I'd like to copy to a multi line text field with a button click in the form. I know that I could do it via workflow but I'd like to do it right in the form if that is possible. Maybe with some javascript magic? All of the search results I find on this show how to do it via workflow. Thanks!
emha,
I am trying your solution and keep getting 'UpdateTextBox' is undefined when I preview the form. Here is what I am currently doing:
1. Modified calculated control formula to this:
UpdateTextBox(<Exististing formula>)
2. Added this snippet to Javascript section of form settings (Recipients is the field I want to update with calc field value)
function UpdateTextBox(inpval){
NWF$('#'+Recipients).val(inpval);
return inpval;
}
What am I doing wrong?
it should work this way....
hopefuly you haven't taken/copied "<Exististing formula>" literally and you've replaced it with your real formula...
have you copied function code to a global scope, ie. out of any function or event handler you might have already had in form settings.
have you checked developer consoile for any errors?
My existing formula is similar to this:
lookup("Field1","ID", parseLookup(ControlName,false), "Recipients")
And I put the code in the Javascript section of the form settings as in the attached screenshot.
I was getting an error saying "Recipients is undefined" with this code. So I used the "Insert Reference" to put the Recipients field in the code. And now it's back to the "UpdateTextBox is undefined" error.
Have you set "Recipients" as you javascript variable ID in the field settings? It should be under Advanced properties
Jack,
I got this copied over to a dev environment so I can save my work and not disrupt the live form that people are using.
I put "Recipients" in the javascript variable fields. That didn't seem to have any effect.
emha,
I opened the developer console, no errors. The only warning was this:
"The code on this page disabled back and forward caching"