attribute has no value
attribute has no value
(OP)
I’m having a problem retrieving a value from an application resource using a bean tag. I don’t have a problem referencing the tag when creating the input field. I’m getting an error, ‘JspTranslate: Attribute textarea.maxchar has no value’, when I use the tag to create a textarea. The code from the JSP follows:
<TR><TD> <input name=busPurposeLen type=text value="<bean:message key="textarea.maxchar" />" size=3 maxlength=3 readonly> characters available</TD></TR>
<TR><TD><html:textarea property="businessPurpose" cols="82" rows="4"
onchange="trim(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)"
onkeydown="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)"
onkeyup="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)" /><BR><BR></TD></TR>
I’m not sure why I’m getting the error using the html:textarea element.
Tom
<TR><TD> <input name=busPurposeLen type=text value="<bean:message key="textarea.maxchar" />" size=3 maxlength=3 readonly> characters available</TD></TR>
<TR><TD><html:textarea property="businessPurpose" cols="82" rows="4"
onchange="trim(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)"
onkeydown="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)"
onkeyup="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar" />)" /><BR><BR></TD></TR>
I’m not sure why I’m getting the error using the html:textarea element.
Tom
RE: attribute has no value
try either escaping your internal quotes with a backslash or using apostrophes around the outside and double quotes on the inside.
-G
RE: attribute has no value
<TD><html:textarea property="businessPurpose" cols="82" rows="4"
onkeydown='textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)'
onkeyup='textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)' /><BR><BR></TD>
The line from the HTML source that is causing the syntax error is:
<TD><textarea name="businessPurpose" cols="82" rows="4" onkeydown="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)"
onkeyup="textCounter(this.form.businessPurpose, this.form.busPurposeLen, <bean:message key="textarea.maxchar"/>)"></textarea><BR><BR></TD>
I understand the syntax error. The bean tag is being generated in the HTML instead of the value. Is there a way I can pass the value instead. I've also tried escaping the internal quotes but this causes another error.
Tom
RE: attribute has no value