struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kote, Nijaguna Sangankal" <nijaguna-sangankal.k...@hp.com>
Subject RE: Javascript error in struts validator.
Date Fri, 02 Jul 2004 14:03:31 GMT
Am using IE 6.0 SP1, should I have msxml?? To work with..?? 

-----Original Message-----
From: Matt Bathje [mailto:mpb@ntsource.com] 
Sent: Friday, July 02, 2004 7:27 PM
To: Struts Users Mailing List
Subject: Re: Javascript error in struts validator.

Niall - I think you mean the 2nd of July. The nighly build from the 2nd
of june still has the broken version of the multi-form fix in it I
believe.

To the original poster:
- Use the nightly build from the 2nd of july:
http://cvs.apache.org/builds/jakarta-struts/nightly/ - at this point you
will no longer be using Struts 1.1, but Struts 1.2.0.
- Make sure that you replace your commons-validator.jar and
validator-rules.xml file with the ones from the nightly build download.
(As well as all other jars!)
- If it still doesn't work - what web browser/version are you using?
Based on your posts, it seems like your problem is with the
form.getAttributeNode("name") javascript command - the getAttributeNode
method is a DOM Level 1 command, which was added to browsers
around/after 2000 I believe. If you are using a non-standard or really
old browser, you may have trouble with it. If you are using a browser
that should support it, throw a javascript debugger on the page and see
what happens.

Matt Bathje

----- Original Message -----
From: "Niall Pemberton" <niall.pemberton@blueyonder.co.uk>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, July 02, 2004 8:11 AM
Subject: Re: Javascript error in struts validator.


> Thats what I was trying to say - the patch (i.e. fix) was applied on
the
1st
> June to <html:javascript>  - try downloading the Struts nightly from
June
> 2nd.
>
> Niall
>
> ----- Original Message ----- 
> From: "Kote, Nijaguna Sangankal" <nijaguna-sangankal.kote@hp.com>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Sent: Friday, July 02, 2004 2:01 PM
> Subject: RE: Javascript error in struts validator.
>
>
> So is there any fix for this???
> I am using struts1.1 and this has stopped my work.
>
> Please give me some hints...
>
> -----Original Message-----
> From: Niall Pemberton [mailto:niall.pemberton@blueyonder.co.uk]
> Sent: Friday, July 02, 2004 6:27 PM
> To: Struts Users Mailing List
> Subject: Re: Javascript error in struts validator.
>
> There was an outstanding bug against the <html:javascript> tag and a
> patch was applied on 1st June
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=29796
>
> Maybe try the version from 2nd June
>
> Niall
>
> ----- Original Message -----
> From: "Kote, Nijaguna Sangankal" <nijaguna-sangankal.kote@hp.com>
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Sent: Friday, July 02, 2004 11:34 AM
> Subject: RE: Javascript error in struts validator.
>
>
> Hi,
> I downoaded, latest nightly build which was on 1st of June...
> and it seems its not working..
>
> it gives some other javascript error.
>
>     function validateRequired(form) {
>         var isValid = true;
>         var focusField = null;
>         var i = 0;
>         var fields = new Array();
>         var formName = form.getAttributeNode("name"); //error is at
this
> line....
>
>         oRequired = eval('new ' + formName.value + '_required()');
>
>
> Can u tell me which version did u download.?? I need to finish of
this.
>
> Regards.
> Guna
>
> -----Original Message-----
> From: hermod.opstvedt@dnbnor.no [mailto:hermod.opstvedt@dnbnor.no]
> Sent: Friday, July 02, 2004 3:22 PM
> To: user@struts.apache.org
> Subject: SV: Javascript error in struts validator.
>
> Hi
>
> I had the same problem - I think it was a mix of old and new struts
> components. What I did was get the latest nightly build, and replace
> everything. After that it all went away.
>
> Hermod
>
> -----Opprinnelig melding-----
> Fra: Kote, Nijaguna Sangankal [mailto:nijaguna-sangankal.kote@hp.com]
> Sendt: 2. juli 2004 10:58
> Til: Struts Users Mailing List
> Emne: RE: Javascript error in struts validator.
>
>
>  Hi Hermod,
>
> Thanks for the reply and the suggestion,
> I should upgrade only the validator ?? Or entire struts??
>
> Regards/Guna
>
> -----Original Message-----
> From: hermod.opstvedt@dnbnor.no [mailto:hermod.opstvedt@dnbnor.no]
> Sent: Friday, July 02, 2004 2:14 PM
> To: user@struts.apache.org
> Subject: SV: Javascript error in struts validator.
>
> Hi
>
> If you look at jsp (view-source) you will probably notice that the
> jscript method (required) has been prefixed with the formname. Upgrade
> to the latest build. This was an issue with validator.
>
> Hermod
>
> -----Opprinnelig melding-----
> Fra: Kote, Nijaguna Sangankal [mailto:nijaguna-sangankal.kote@hp.com]
> Sendt: 2. juli 2004 08:38
> Til: user@struts.apache.org
> Emne: Javascript error in struts validator.
>
>
> Hi All,
> I had posted this question, but got now answer. Please give me
> some hints on this.
>
> I am getting javascript error when I click on submit to validate
> my form.
> It's a simple login page with username and password.
>
> here is the code for login.jsp
>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib
> uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> <%
>     response.setHeader("pragma", "no-cache");
>     response.setHeader("Cache-control", "no-cache, no-store");
>     response.setHeader("Expires", "0");
> %>
>
> <html:html locale="true">
>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
> <link href="../css/asianet.css" type=text/css rel=stylesheet>
> <title><bean:message key="title.login"/></title>
> <html:javascript formName="loginForm"/> - This is how I am
> including the Javascript for validation.
> </head>
> ........................................... Rest body code goes here.
> </html:html>
>
> This is my validation.xml file
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>
> <!DOCTYPE form-validation PUBLIC
>           "-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.1//EN"
>           "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
>
> <form-validation>
>
>     <formset>
>
>         <form    name="loginForm">
>             <field     property="j_username"
>                         depends="required">
>                 <arg0 key="prompt.userid"/>
>             </field>
>
>             <field     property="j_password"
>                         depends="required">
>                    <arg0 key="prompt.password"/>
>             </field>
>
>         </form>
>     </formset>
>
> </form-validation>
>
> And validation-rules.xml file
> <form-validation>
>
>    <global>
>
>       <validator name="required"
>             classname="org.apache.struts.validator.FieldChecks"
>                method="validateRequired"
>          methodParams="java.lang.Object,
>                        org.apache.commons.validator.ValidatorAction,
>                        org.apache.commons.validator.Field,
>                        org.apache.struts.action.ActionErrors,
>                        javax.servlet.http.HttpServletRequest"
>                   msg="errors.required">
>
>          <javascript><![CDATA[
>             function validateRequired(form) {
>                 var isValid = true;
>                 var focusField = null;
>                 var i = 0;
>                 var fields = new Array();
>                 oRequired = new required();  //-> here is the error.
>                 for (x in oRequired) {
>                 var field = form[oRequired[x][0]];
>
>                     if (field.type == 'text' ||
>                         field.type == 'textarea' ||
>                         field.type == 'file' ||
>                         field.type == 'select-one' ||
>                         field.type == 'radio' ||
>                         field.type == 'password') {
>                         .............................. Rest
>
> Now when I load my jsp, struts generates javascript with
> validateLoginForm( document.loginForm )mehtod.
> But, when I click on submit button. I get javascript error saying
> "required is undefined" and it points to the above bold line in
> Validation-rules.xml file.
>
> I am not able to figure out why, any ideas or hints on this would help
> me a lot.
>
> Thanks
> Guna
>
>
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
> * *
>
> This email with attachments is solely for the use of the individual or
> entity to whom it is addressed. Please also be aware that DnB NOR
cannot
> accept any payment orders or other legally binding correspondence with
> customers as a part of an email.
>
> This email message has been virus checked by the virus programs used
in
> the DnB NOR Group.
>
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
> * *
>
>
> ---------------------------------------------------------------------
> 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
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
>
>
>
> ---------------------------------------------------------------------
> 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



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message