I need to give a default value for input type=text field as follows:
<input type="text" size="32" value="" name="fee" />
There is one way to give this default value as I know:
<input type="text" size="32" value="1000" name="fee" />
Here is the question: Is it possible that I can set the default value without using attribute 'value'?
As I know, if I set the enter the value 1000 manually, and then view the source through web browser the value is still empty. So I think there may be a method that I can use.
What is the default type of 'type' attribute of <input> element? Explanation: Text input type defines single line text field. Type is the attribute that displays type of <input> elements. Its default type is text.
The default type of <input> type attribute is text.
The DefaultValue property specifies text or an expression that's automatically entered in a control or field when a new record is created.
You should rather use the attribute placeholder to give the default value to the text input field.
e.g.
<input type="text" size="32" placeholder="1000" name="fee" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With