2

I know, the below code will display the value in HTML format like <b>DATA< /b>, will be displayed as <b>DATA</b>.

<s:property value="workItem.Note" escapeHtml="false"/>

How can we achieve same with <s:textarea name="workItem.Note" value=""/>?. Text area displays value in normal string format like <b>DATA</b> not in HTML. Here I am assigning value from JavaScript that is coming from db in String format containing HTML.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Abhishek Singh
  • 1,367
  • 1
  • 22
  • 46

1 Answers1

2

Use HTML textarea tag

<textarea name="workItem.Note">
   <s:property value="workItem.Note"/>
</textarea>
Roman C
  • 49,761
  • 33
  • 66
  • 176
  • you are right sir. but I am assigning value from javascript into textarea. So, I think no benefit to use property tag inside textarea. – Abhishek Singh Aug 28 '15 at 13:11
  • What a benefit to use javascript? I will grant you the [link](http://stackoverflow.com/q/415602/573032). – Roman C Aug 28 '15 at 13:20
  • on page load, I m bringing a List from action, and creating some hidden fields iterating it. and on radio button, I m picking value of certain hidden field and setting its value to one Common TextArea. and that hidden field contains string with html tags. That's it. – Abhishek Singh Aug 28 '15 at 13:38
  • On page load you should already have a field populated from the action when result has been executed. So you can use something`$("textarea[name='workItem.Note']").val($("input:hidden").val());` – Roman C Aug 28 '15 at 13:48