
form input field initial value truncate after space
Two solutions:
1) <td><input type="text" name="T1_name" size=40
value='<% Name_var%>'></td>
2) <td><input type="text" name="T1_name" size=40
value=<%Server.HTMLEncode(Name_var)%>></td>
Solution 2) is actually the more robust solution since it encodes all characters that are
significant in HTML syntax.
--
Michael Harris
Microsoft.MVP.Scripting
--
Quote:
> To any one who can help me:
> In my form input text field, inside a table, if I specify
> <td><input type="text" name="T1_name" size=40 value = "My Name"</td>, it
> displays this initial value correctly with the space.
> But if I specify:
> <%Name_var="My Name"%>
> <td><input type="text" name="T1_name" size=40 value=<% Name_var%>></td>
> it truncates everything after the space.
> How can I preserve the space and use the value of the variable in the
> initial value of the text input form.
> Thank You in advance for your response.
> - Myrtle