This project has moved. For the latest updates, please go here.

field SetValue on Dispform.aspx

Jul 24, 2015 at 10:42 AM
Hello Kit,
I don't know if the issue is similar to GetValue (that works using "LabelRow.down(0).next('td').getTextContent().strip()"), but is there any way to make SetValue work on a text field (and multiline too)?
In addition, is there a way to Replace the content of the multi-line field with the content of a variable?
For instance, into a multiline text field "Hello name, I don't know if the issue....." change each recurrence of "name" with the field NAME, that could contain "Kit", so that the final field would be "Hello Kit, I don't know if the issue....".
Thank you,
Aug 3, 2015 at 11:45 PM
Sorry for the delay, been busy.

Are you talking about using SetValue on the DispForm? If so, SPUtility.js doesn't support that yet.

If you're talking about SetValue on EditForm or NewForm, you should be able to GetValue first and then use javascript's replace method to substitute the text.

Also, when do you want this substitution to happen? When the user saves the form or when the form loads for the first time? I might be able to give you a recommendation there too.
Aug 4, 2015 at 4:10 PM
Dear Kit,
thank you for the answer.
Yes.... I was trying to use it on DispForm, so I'll look for other solutions.
Anyway, the methods for EditForm and NewForm should be useful in other occasions.