You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eduardo José Hernández Cisneros <ej...@hotmail.com> on 2005/07/01 18:04:41 UTC
and Struts 1.2.7 possible bug?
Hi everybody,
I recently upgrade my struts libraries to 1.2.7 from 1.2.4. I am using
the <html:xhtml/> tag with:
<html:form action="saveUser" focus="name" styleId="productTypeForm"
onsubmit="return validateProductTypeForm(this)">
</html:form>
In 1.2.4 version the html:form tag renders correctly the form name
attribute, but when a I changed to 1.2.7 the form name disappeared and this
causing trouble with a javascript client-side validation that I am using.
The funny part is that when I remove <html:xhtml/> tag with 1.2.7 version
the form name appears again.
Am I using wrongly the <html:xhtml/> tag or could it be a bug?
Thank you for your time.
--Eduardo
_________________________________________________________________
T1msn Fotos: Todo lo que quieres saber sobre fotografía digital
http://search.t1msn.com.mx/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: and Struts 1.2.7 possible bug?
Posted by Xi Ping Wang <xi...@gmail.com>.
There is no name attribute in form tag according to xhtml
specification. So if you use <html:xhtml/> or <html:html
xhtml="true"/> , name attribute will not be generated.
You can use id attribute to identify your form.
2005/7/2, Eduardo José Hernández Cisneros <ej...@hotmail.com>:
> Hi everybody,
>
> I recently upgrade my struts libraries to 1.2.7 from 1.2.4. I am using
> the <html:xhtml/> tag with:
>
> <html:form action="saveUser" focus="name" styleId="productTypeForm"
> onsubmit="return validateProductTypeForm(this)">
> …
>
> </html:form>
>
> In 1.2.4 version the html:form tag renders correctly the form name
> attribute, but when a I changed to 1.2.7 the form name disappeared and this
> causing trouble with a javascript client-side validation that I am using.
> The funny part is that when I remove <html:xhtml/> tag with 1.2.7 version
> the form name appears again.
>
> Am I using wrongly the <html:xhtml/> tag or could it be a bug?
>
> Thank you for your time.
>
> --Eduardo
>
> _________________________________________________________________
> T1msn Fotos: Todo lo que quieres saber sobre fotografía digital
> http://search.t1msn.com.mx/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: and Struts 1.2.7 possible bug?
Posted by Tobias Neumann <to...@gmail.com>.
On 2005-07-01 18:04:41 +0200, Eduardo José Hernández Cisneros
<ej...@hotmail.com> said:
> Hi everybody,
>
> I recently upgrade my struts libraries to 1.2.7 from 1.2.4. I am
> using the <html:xhtml/> tag with:
>
> <html:form action="saveUser" focus="name" styleId="productTypeForm"
> onsubmit="return validateProductTypeForm(this)">
>
>
> </html:form>
>
> In 1.2.4 version the html:form tag renders correctly the form name
> attribute, but when a I changed to 1.2.7 the form name disappeared and
> this causing trouble with a javascript client-side validation that I am
> using. The funny part is that when I remove <html:xhtml/> tag with
> 1.2.7 version the form name appears again.
>
> Am I using wrongly the <html:xhtml/> tag or could it be a bug?
>
> Thank you for your time.
>
> --Eduardo
In the XHTML standard 1.0 the name attribute is marked as obsolete.
You must now specifiy an id attribute (with styleId="formName").
To fix the bug with javascript validation/focus and the id-attribute,
you need to get the latest jakarta commons-validator from the svn
repository so that javascript validation
recognizes the id attribute as the form name too.
Tobias
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: and Struts 1.2.7 possible bug?
Posted by Ivan Rodriguez <iv...@interd4u.com>.
I have the same situation that yours. My solution is to save the static
part of validator in an static .js file
<script type="text/javascript" src="/scripts/validator.js"></script>
...and replace all ocurrences of
var formName = form.getAttributeNode("name");
with
var formName = form.getAttributeNode("id");
My previous setup was
<script type="text/javascript" src="<c:url
value="/scripts/validator.jsp"/>"> </script>
Inside validator.jsp there was:
<%@ page language="java" contentType="javascript/x-javascript" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<html:javascript dynamicJavascript="false" staticJavascript="true"/>
Like this you can save the javascript functions, pointing your browser
to http://host/context/scripts/validador.jsp
Niall Pemberton escribió:
>Its a bug in Version 1.2.7 caused by the changes for Bug 34027. It has been
>reported in Bug 35127 and a fix has been applied
>
>I have upated the upgrade notes on the wiki to make a note of this:
>
>http://wiki.apache.org/struts/StrutsUpgradeNotes124to127
>
>Niall
>
>----- Original Message -----
>From: "Eduardo José Hernández Cisneros" <ej...@hotmail.com>
>Sent: Friday, July 01, 2005 5:04 PM
>
>
>
>
>>Hi everybody,
>>
>> I recently upgrade my struts libraries to 1.2.7 from 1.2.4. I am using
>>the <html:xhtml/> tag with:
>>
>><html:form action="saveUser" focus="name" styleId="productTypeForm"
>> onsubmit="return validateProductTypeForm(this)">
>>.
>>
>></html:form>
>>
>>In 1.2.4 version the html:form tag renders correctly the form name
>>attribute, but when a I changed to 1.2.7 the form name disappeared and
>>
>>
>this
>
>
>>causing trouble with a javascript client-side validation that I am using.
>>The funny part is that when I remove <html:xhtml/> tag with 1.2.7 version
>>the form name appears again.
>>
>>Am I using wrongly the <html:xhtml/> tag or could it be a bug?
>>
>>Thank you for your time.
>>
>>--Eduardo
>>
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: and Struts 1.2.7 possible bug?
Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Its a bug in Version 1.2.7 caused by the changes for Bug 34027. It has been
reported in Bug 35127 and a fix has been applied
I have upated the upgrade notes on the wiki to make a note of this:
http://wiki.apache.org/struts/StrutsUpgradeNotes124to127
Niall
----- Original Message -----
From: "Eduardo José Hernández Cisneros" <ej...@hotmail.com>
Sent: Friday, July 01, 2005 5:04 PM
> Hi everybody,
>
> I recently upgrade my struts libraries to 1.2.7 from 1.2.4. I am using
> the <html:xhtml/> tag with:
>
> <html:form action="saveUser" focus="name" styleId="productTypeForm"
> onsubmit="return validateProductTypeForm(this)">
> .
>
> </html:form>
>
> In 1.2.4 version the html:form tag renders correctly the form name
> attribute, but when a I changed to 1.2.7 the form name disappeared and
this
> causing trouble with a javascript client-side validation that I am using.
> The funny part is that when I remove <html:xhtml/> tag with 1.2.7 version
> the form name appears again.
>
> Am I using wrongly the <html:xhtml/> tag or could it be a bug?
>
> Thank you for your time.
>
> --Eduardo
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org