You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "James Holmes (JIRA)" <ji...@apache.org> on 2008/12/16 04:45:38 UTC
[jira] Updated: (WW-2704) Form focusElement attribute not resulting
in correct Javascript
[ https://issues.apache.org/struts/browse/WW-2704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Holmes updated WW-2704:
-----------------------------
Fix Version/s: 2.1.3
> Form focusElement attribute not resulting in correct Javascript
> ---------------------------------------------------------------
>
> Key: WW-2704
> URL: https://issues.apache.org/struts/browse/WW-2704
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.1.2
> Environment: struts2-core-2.1.2 xwork-2.1.1 struts.ui.theme=xhtml
> Reporter: Owen Berry
> Priority: Minor
> Fix For: 2.1.3
>
>
> The Javascript generated for the focusElement attribute on a form is incorrect as it does not include the form id as a prefix for the id of the element to focus on. See example below.
> Sample form:
> <s:form id="dologin" method="post" namespace="/" action="dologin" focusElement="username">
> <s:textfield label="User" name="username" />
> <s:password label="Password" name="password" />
> <s:submit value="Login" />
> </s:form>
> Generated form tag:
> <input type="text" name="username" value="" id="dologin_username"/>
> Generated Javascript:
> StrutsUtils.addOnLoad(function() {
> var element = document.getElementById("username");
> if(element) {
> element.focus();
> }
> });
> What Javascript should look like:
> StrutsUtils.addOnLoad(function() {
> var element = document.getElementById("dologin_username");
> if(element) {
> element.focus();
> }
> });
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.