I want to use the value of textarea present within a template. My code is as below:
<tr>
<td style="background-color:#ffffff; padding:40px 22px; font-family:Arial, Helvetica, sans-serif; color:#505050; font-size:12px; font-weight:normal;">
**[[NEWSLETTER_BODY]]**
</td>
</tr>
I want to use the value from the Javascript function below at the place [[NEWSLETTER_BODY]]. Can you help me in this regard? Thanks in advance.
{literal}
<script language="javascript" type="text/javascript">
function get_text_area_value(){
var email_body = jQuery("textarea#newsletter_email_body").val();
//alert(email_body);
}
</script>
{/literal}
Actually I want to call this function in following fashion. At the same time the value should be there in the smarty template.
<input type="button" name="btn_preview" id="btn_preview" value="{$preview_value}" class="submit" id="preview_newsletter" onclick="get_text_area_value()">