I'm using the wp.template()
to create a BackBone JS template which comes with WordPress by default.
I have a template defined as:
<script type="text/html" id="tmpl-pre-registration">
<div className="stvp-preregistration">
<form className="stvp-preregistration__form" id="stvp-preregistration__form">
<label htmlFor="stvp-preregistration__email-input">{{ data.name }}</label>
<input placeholder='Email' type="email" name="stvp-preregistration-email-input" id="stvp-preregistration-email-input"/>
<input id="stvp-preregistration__email-submit" type="submit" disabled />
</form>
<p className="stvp-preregistration__message">Some Message</p>
</div>
</script>
I am trying to set certain values in the template which I receive from Ajax response.
But my Ajax response includes the above script with it.
As you see, I just want the response to be:
{"success":false,"exit":false}
Can anyone explain why this happens?