kavishshukla
asked on
pre fill input text field of html form
hello,
I have a simple html form as below:
<form action="page1.php" method="post">
<table>
<td> <input type="text" name="username" size="20" maxlength="40" id="user"><br>
</td>
</table>
<input type="submit" value="login" name="submit">
What should I add to this code so that the input field will be filled up with some text like "username here" when this page is opened.
I have a simple html form as below:
<form action="page1.php" method="post">
<table>
<td> <input type="text" name="username" size="20" maxlength="40" id="user"><br>
</td>
</table>
<input type="submit" value="login" name="submit">
What should I add to this code so that the input field will be filled up with some text like "username here" when this page is opened.
if the default value is coming from a variable, like a query, or a url, then you should be sure to wrap it in the htmlEditFormat function... and it will need to be inside <cfoutput> tags....
<input type="text" name="username" size="20" maxlength="40" id="user" value=<cfoutput>"#htmlEdit Format(var name)#"</c foutput>>
<input type="text" name="username" size="20" maxlength="40" id="user" value=<cfoutput>"#htmlEdit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
All you have to do is indicate a value like so:
<input type="text" name="username" size="20" maxlength="40" id="user" value="username here">