Inconsistency between display in javascript and non-javascript error messages
containing HTML
---------------------------------------------------------------------------------------------
Key: VELTOOLS-77
URL: https://issues.apache.org/jira/browse/VELTOOLS-77
Project: Velocity Tools
Issue Type: Bug
Components: VelocityStruts
Environment: Struts 1.3.5 / Velocity 1.4 / Velocity Tools 1.2
Reporter: Christopher Schultz
Priority: Trivial
When error messages contain HTML markup, the messages are displayed as expected
by $error.getMsgs(fieldName), but not in javascript messages.
Easy to demonstrate:
1. Start with typical struts/validator/velocity/velocity-tools setup
2. Modify stock error message "errors.required" from
errors.required=The field {0} is required.
to:
errors.required=The field <i>{0}</i> is required.
3. Induce form rejection (required field) with javascript turned OFF
Result: Error message is displayed with fieldname in italics.
4. Repeat form failure with javascript turned ON
Result: Error message is displayed in javascript alert with unsightly <i> and
</i> markup displayed. (Same problem occurs with more likely things such as
HTML entities (i.e. &)).
Expected: Markup removed?
I realize that javascript popups are not generally expected to properly render
markup. Perhaps error messages put into javascript validation could have markup
removed. I also realize that this is a non-trivial fix and kind of a minefield.
;)
Feel free to re-categorize this issue as something other than a "bug". I just
figured that inconsistent behavior (IMO) called for "bug" status. Since I'm not
offering a solution just yet, I didn't want to categorize it as an
"improvement".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]