struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Hong <anthony.bin.h...@gmail.com>
Subject Re: validation issue
Date Thu, 10 Mar 2005 01:26:37 GMT
If you want to set some value befroe generated javascript to do validation.
You can wrtie a your own javascript function and then invoke its
generated function.

eg:
change jsp page
<html:form onsubmit="return myFunction(this)"
action="/logon" method="post">

write a new function in your own javascript
function myFunction(myform) {
    //set your form value here from hidden input field.

    return validateLogonForm(myform);
}


On Wed, 9 Mar 2005 16:34:49 -0800 (PST), wo_shi_ni_ba_ba
<wo_shi_ni_ba_ba@yahoo.com> wrote:
> thanks, but I need it to be links to a graphics
> instead of button, any alternative?
> 
> 
> --- Hubert Rabago <hrabago@gmail.com> wrote:
> > Use the <html:cancel> tag for your Previous button.
> >
> >
> > On Wed, 9 Mar 2005 15:30:27 -0800 (PST),
> > wo_shi_ni_ba_ba
> > <wo_shi_ni_ba_ba@yahoo.com> wrote:
> > > dear folks,
> > > I am using struts validator framework for both
> > > clientside and serverside validation.  On the jsp
> > > page, I have a previous and next button, if the
> > user
> > > clicks previous I don't want to validate; if the
> > user
> > > clicks next I want to validate.   However I can
> > not
> > > modify the javascript function validateLogonForm
> > > because its dynamically generated.  What's the
> > best
> > > practice here to achieve my goal?  for client side
> > > validation, I am thinking about inserting a hidden
> > > field, and then have two javascript functions
> > > handlePrevious and handleNext that will set the
> > value
> > > of this field before submit the form, and then use
> > > validation rule like validwhen.  Is this a
> > valid/good
> > > approach?
> > >
> > > Here is what my form looks like:
> > > <html:form onsubmit="return
> > validateLogonForm(this)"
> > > action="/logon" method="post">
> > >
> > > __________________________________
> > > Celebrate Yahoo!'s 10th Birthday!
> > > Yahoo! Netrospective: 100 Moments of the Web
> > > http://birthday.yahoo.com/netrospective/
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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!?
> Make Yahoo! your home page
> http://www.yahoo.com/r/hs
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 

Anthony Hong

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


Mime
View raw message