I have a form on a page. I have a link acting as submit button. The value is sent to a php page via ajax where the value is set into a session.
After submit I swap the form with text field where the text is displayed. How do I use the text from the submitted form to display withing <pre></pre> tags?
$("#btnPreview").click(function() {
var custM = $("#inviteMsg").val();
$.ajax({
url: "ajax.php",
type: "POST",
data: "msg="+custM
});
});
<div id="customMsgPreview">
<div class="rollSec">
<pre>
// SUBMITTED TEXT NEEDS TO APPEAR HERE
'.$tstLnk.'
</pre>
</div>