I wanted to add a superscript dynamically to the values comes in sample xml. I cannot hard code the superscript in textfield because the values populated from sample xml. is there a way to achieve this?
I have see few posts about super script but they did not really help my requirement. I am attaching the screenshot how I need the output to be.
All the data (product name, category, code ..) comes from sample xml. I need to add superscript to Product based on some logic.
I tried something like making the textfield as Richtext and append the superscript but no luck.
Textfield.rawvalue = xfa.resolveNode("xfa.record.main.Productname").value + <sup>1</sup>
Any help please?
var cSourceText = PlainTextField.rawValue,
cSuperScript = "1",
xHTML = "<body xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\"><p style=\"letter-spacing:0in\">" + cSourceText + "<sup>" + cSuperScript + "</sup></p></body>";
RichTextField.value.exData.loadXML(xHTML, false, true);
Thank you. I just did how you mentioned. But no luck. my rich text fiels is empty. I have written this code in Calculate event of the richtext field. and value for Plain text field is coming from sample xml. Not sure why it is not working for me.
This is a side effect of the calculate event in the target text field. The value is there but not displayed by the text fields widget.
Add the script in the calculate event of another element like a surrounding subform or a hidden button.
It worked. Thank you so much