You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jonathan M Z <wo...@yahoo.com> on 2005/02/16 00:55:21 UTC
javascript validation in struts
Hi folks,
I am trying to understand struts validation from some
example code, it has something like this:
<html:form onsubmit="return validateSigninForm(this)"
action="signin" method="post">
validateSigninForm is a javascript validation. I
looked up in validation.xml and validator-rules,
neither this javascript function nor anything contain
the word "signin" is to be found, so how does struts
do its magic clientside validation? (the jsp itself
obviously does not have this javasription function
either.
thanks!
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to receive emails related to my questions only?
Posted by Vic <vi...@friendvu.com>.
What if you know the answer to someone's question?
.V
Jonathan M Z wrote:
>hi folks, I am new to the list, I did some search on
>my question but no luck. Is there a way that I only
>receive emails related to my post?
>thank you
>
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail - now with 250MB free storage. Learn more.
>http://info.mail.yahoo.com/mail_250
>
>
--
Forums, Boards, Blogs and News in RiA <http://www.boardVU.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: weird problem generating javascript validation from xml
Posted by Mr Maillist <dw...@gmail.com>.
try <html:javascript formName="logonForm" dynamicJavascript="true">
On Wed, 16 Feb 2005 10:39:11 -0800 (PST), Jonathan M Z
<wo...@yahoo.com> wrote:
> hi folks, I am having some problem with javascript
> validation code generation.
>
> I have the following code in my jsp(only showing the
> relevant ones):
>
> <html:form onsubmit="return validateLogonForm(this)"
> action="/logon" method="post">
> <script language="javascript">
> <html:javascript
> formName="logonForm"></html:javascript>
> </script>
>
> I have the following in validation.xml
> <form-validation>
>
> <!-- ========== Default Language Form Definitions
> ===================== -->
> <formset>
>
> <form name="logonForm">
>
> <field property="userName"
> depends="minlength,maxlength">
> <arg0 key="prompt.username"/>
> <arg1 key="${var:minlength}"
> name="minlength"
> resource="false"/>
> <arg2 key="${var:maxlength}"
> name="maxlength"
> resource="false"/>
> <var>
> <var-name>maxlength</var-name>
> <var-value>16</var-value>
> </var>
> <var>
> <var-name>minlength</var-name>
> <var-value>3</var-value>
> </var>
> </field>
> ...
>
> I have the following in my struts configuration file:
> <plug-in
> className="org.apache.struts.validator.ValidatorPlugIn">
> <set-property property="pathnames"
> value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> </plug-in>
> <form-beans>
> <form-bean name="logonForm"
>
> type="com.xxx.software.xxx.security.LogonForm"/>
>
> </form-beans>
>
> <action-mappings>
> <action path="/logon" name ="logonForm"
> type="com.xxx.software.xxx.security.LogonAction">
> </action>
> </action-mappings>
>
> The problem is that the default javascription
> functions from validation-rule.xml are generated(eg.
> validateByte, validateFloat) but not
> validateLogonForm().
> what's wrong here?
>
> __________________________________
> Do you Yahoo!?
> All your favorites on one personal page – Try My Yahoo!
> http://my.yahoo.com
>
> ---------------------------------------------------------------------
> 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: how to receive emails related to my questions only?
Posted by Jonathan M Z <wo...@yahoo.com>.
there's no server side configuration from the mailing
list that i can tweak?
thanks
--- Soaring Eagle <co...@gmail.com> wrote:
> try using gmail... organizes your email pretty well.
>
>
> On Wed, 16 Feb 2005 10:06:02 -0800 (PST), Jonathan M
> Z
> <wo...@yahoo.com> wrote:
> > hi folks, I am new to the list, I did some search
> on
> > my question but no luck. Is there a way that I
> only
> > receive emails related to my post?
> > thank you
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - now with 250MB free storage. Learn
> more.
> > http://info.mail.yahoo.com/mail_250
> >
> >
>
---------------------------------------------------------------------
> > 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
>
>
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to receive emails related to my questions only?
Posted by Joe Germuska <Jo...@Germuska.com>.
>On Wed, 16 Feb 2005 10:06:02 -0800 (PST), Jonathan M Z
><wo...@yahoo.com> wrote:
>> hi folks, I am new to the list, I did some search on
>> my question but no luck. Is there a way that I only
>> receive emails related to my post?
> > thank you
You might try using the list via the GMane archives, which provide a
threaded interface in a web browser; should be a reasonable way to
key in on your topics and ignore others. If you have a USENET
client, you can use it with GMane in an even more sophisticated
manner, such as killing topics you don't want to see, etc.
http://news.gmane.org/gmane.comp.jakarta.struts.user
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
weird problem generating javascript validation from xml
Posted by Jonathan M Z <wo...@yahoo.com>.
hi folks, I am having some problem with javascript
validation code generation.
I have the following code in my jsp(only showing the
relevant ones):
<html:form onsubmit="return validateLogonForm(this)"
action="/logon" method="post">
<script language="javascript">
<html:javascript
formName="logonForm"></html:javascript>
</script>
I have the following in validation.xml
<form-validation>
<!-- ========== Default Language Form Definitions
===================== -->
<formset>
<form name="logonForm">
<field property="userName"
depends="minlength,maxlength">
<arg0 key="prompt.username"/>
<arg1 key="${var:minlength}"
name="minlength"
resource="false"/>
<arg2 key="${var:maxlength}"
name="maxlength"
resource="false"/>
<var>
<var-name>maxlength</var-name>
<var-value>16</var-value>
</var>
<var>
<var-name>minlength</var-name>
<var-value>3</var-value>
</var>
</field>
...
I have the following in my struts configuration file:
<plug-in
className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
<form-beans>
<form-bean name="logonForm"
type="com.xxx.software.xxx.security.LogonForm"/>
</form-beans>
<action-mappings>
<action path="/logon" name ="logonForm"
type="com.xxx.software.xxx.security.LogonAction">
</action>
</action-mappings>
The problem is that the default javascription
functions from validation-rule.xml are generated(eg.
validateByte, validateFloat) but not
validateLogonForm().
what's wrong here?
__________________________________
Do you Yahoo!?
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to receive emails related to my questions only?
Posted by Soaring Eagle <co...@gmail.com>.
try using gmail... organizes your email pretty well.
On Wed, 16 Feb 2005 10:06:02 -0800 (PST), Jonathan M Z
<wo...@yahoo.com> wrote:
> hi folks, I am new to the list, I did some search on
> my question but no luck. Is there a way that I only
> receive emails related to my post?
> thank you
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - now with 250MB free storage. Learn more.
> http://info.mail.yahoo.com/mail_250
>
> ---------------------------------------------------------------------
> 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
how to receive emails related to my questions only?
Posted by Jonathan M Z <wo...@yahoo.com>.
hi folks, I am new to the list, I did some search on
my question but no luck. Is there a way that I only
receive emails related to my post?
thank you
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: javascript validation in struts
Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
The <html:javascript> tag dynamically generates the function for you - you
should find that somewhere on the JSP page.
http://struts.apache.org/userGuide/struts-html.html#javascript
Niall
----- Original Message -----
From: "Jonathan M Z" <wo...@yahoo.com>
Sent: Tuesday, February 15, 2005 11:55 PM
> Hi folks,
> I am trying to understand struts validation from some
> example code, it has something like this:
>
> <html:form onsubmit="return validateSigninForm(this)"
> action="signin" method="post">
>
> validateSigninForm is a javascript validation. I
> looked up in validation.xml and validator-rules,
> neither this javascript function nor anything contain
> the word "signin" is to be found, so how does struts
> do its magic clientside validation? (the jsp itself
> obviously does not have this javasription function
> either.
> thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: javascript validation in struts
Posted by Carlos Cajina <ce...@hotmail.com>.
Hi Jonathan.
A quick "dissection" of the code you posted might clarify some of your
doubts..
<html:form
* You know what this is...
onsubmit="return validateSigninForm(this)"
* This piece of code calls a dynamically generated JavaScript function
that's created when the page is rendered (for this to happen you have to
include <html:javascript formName="signin" /> within the JSP containing the
form.) As you can see, the function name is composed of three parts:
"validate", which is a default value, + "Signin", which is the name of your
form and the name specified in the <html:javascript... /> tag, + "Form",
which is another default value.
action="signin"
* This is just the Action name that's defined in struts-config.xml for this
JSP an its associated Form bean.
method="post">
* You also know what this is :^)
The validating JavaScript functions containing the different kinds of
validation for a given form are generated within the JSP code (although you
can override this default behavior. See
http://struts.apache.org/userGuide/struts-html.html#javascript). You should
check the examples included in the Struts distribution to verify this (view
source of JSP's after the browser renders'em).
On every submit the JavaScript validation routines are called for every
field participating in the validation process.
Hope it helps...
Regards,
Carlos
----- Original Message -----
From: "Jonathan M Z" <wo...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Tuesday, February 15, 2005 5:55 PM
Subject: javascript validation in struts
> Hi folks,
> I am trying to understand struts validation from some
> example code, it has something like this:
>
> <html:form onsubmit="return validateSigninForm(this)"
> action="signin" method="post">
>
> validateSigninForm is a javascript validation. I
> looked up in validation.xml and validator-rules,
> neither this javascript function nor anything contain
> the word "signin" is to be found, so how does struts
> do its magic clientside validation? (the jsp itself
> obviously does not have this javasription function
> either.
> thanks!
>
>
>
> __________________________________
> Do you Yahoo!?
> The all-new My Yahoo! - Get yours free!
> http://my.yahoo.com
>
>
>
> ---------------------------------------------------------------------
> 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: javascript validation in struts
Posted by Kumar deepak <de...@yahoo.com>.
Hi,
Please visit http://www.roseindia.net/struts/struts_validator_framework.shtml
Regards
Deepak kumar
Jonathan M Z <wo...@yahoo.com> wrote:
Hi folks,
I am trying to understand struts validation from some
example code, it has something like this:
action="signin" method="post">
validateSigninForm is a javascript validation. I
looked up in validation.xml and validator-rules,
neither this javascript function nor anything contain
the word "signin" is to be found, so how does struts
do its magic clientside validation? (the jsp itself
obviously does not have this javasription function
either.
thanks!
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com