i got error because am using placeholder attribute in struts tags....
<html:text property="name" styleClass="form-control" placeholder="some text"/>
how can resolve the problem,pls help me.
Thanks in Advance.
The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format). The short hint is displayed in the input field before the user enters a value.
Placeholder text, located inside a form field, is an additional hint, description, or example of the information required for a particular field. These hints typically disappear when the user types in the field.
If you want to set a hint for text area or input field, then use the HTML placeholder attribute. The hint is the expected value, which gets displayed before the user enters a value, for example, name, details, etc.
The placeholder attribute specifies a short hint that describes the expected value of a input field / textarea. The short hint is displayed in the field before the user enters a value.
Use jQuery attr
like below:
<html:text property="name" styleClass="form-control" styleId="abc" />
JavaScript code:
$(function() {
$("#abc").attr("placeholder", "some text");
});
Just replace:
<html:text property="name" styleClass="form-control" placeholder="some text" />
With:
<input type="text" name="property" class="form-control" placeholder="some text"
│
└─── Form property ────┐
│
value="<bean:write name="name" property="property" />" />
│
Name of form-bean ─┘
The value of the attribute name
must match the property of your form to trip in the request.
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