I'm using javascript (backbone) to fill out an HTML form template. The form is an edit form, so it will be populated with existing values.
Unfortunately, when I browse to the form, values for a text input are getting truncated. For example, say the value of the field should be populated with "hello world" - but the form only shows the word before the space (hello) and the actual source looks like this (notice it thinks world is an attribute):
<input type="text" name="name" id="name" value="hello" world="">`
I'm not a huge HTML/Javascript expert. Does anyone know how I can escape the input?
Here's the template text that generates that form:
I'm not a huge HTML/Javascript expert. Does anyone know how I can escape the input?
Here's the template text that generates that form:
<h1>Edit activity</h1>
<form id="edit-activity" name="activity">
<div class="field">
<label for="name"> name:</label>
<input type="text" name="name" id="name" value=<%= name %> >
</div>
<div class="actions">
<input type="submit" value="Update Activity" />
</div>
</form>
<a href="#/index">Back</a>
<input>?