You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Stavrinides <p....@albourne.com> on 2007/11/09 10:24:23 UTC
Tapestry 4.1.3 validation
I want to run some custom JavaScript validation functions before the
submit listener is called, something like this:
<script>
function validateForm(obj){
//checks go here
return false;
}
</script>
<form jwcid="profileForm@Form" onSubmit="return validateForm(this)"
delegate="ognl:beans.errorLog"
listener="listener:formSubmit" clientValidationEnabled=true>
</form>
If validateForm returns false I don't want to submit, but the listener
method 'formSubmit' always seems to be called regardless, I am sure this
is very trivial but I just can't find it.
Thanks in advance,
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 4.1.3 validation
Posted by Kevin Menard <km...@servprise.com>.
Sorry, I misunderstood the original question. Andy's answer should be more
helpful.
--
Kevin
On 11/9/07 11:13 AM, in article 4734871E.40909@albourne.com, "Peter
Stavrinides" <p....@albourne.com> wrote:
> Thanks Kevin, but that didn't work?
>
> Kevin Menard wrote:
>> Change listener="listener:formSubmit" to success="listener:formSubmit"
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 4.1.3 validation
Posted by Peter Stavrinides <p....@albourne.com>.
Thanks Kevin, but that didn't work?
Kevin Menard wrote:
> Change listener="listener:formSubmit" to success="listener:formSubmit"
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 4.1.3 validation
Posted by Kevin Menard <km...@servprise.com>.
Change listener="listener:formSubmit" to success="listener:formSubmit"
--
Kevin
On 11/9/07 4:24 AM, in article 47342747.40607@albourne.com, "Peter
Stavrinides" <p....@albourne.com> wrote:
>
> I want to run some custom JavaScript validation functions before the
> submit listener is called, something like this:
>
> <script>
> function validateForm(obj){
> //checks go here
>
> return false;
> }
> </script>
>
> <form jwcid="profileForm@Form" onSubmit="return validateForm(this)"
> delegate="ognl:beans.errorLog"
> listener="listener:formSubmit" clientValidationEnabled=true>
> </form>
>
> If validateForm returns false I don't want to submit, but the listener
> method 'formSubmit' always seems to be called regardless, I am sure this
> is very trivial but I just can't find it.
>
> Thanks in advance,
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 4.1.3 validation
Posted by Andreas Andreou <an...@gmail.com>.
They are... but that one is a reserved parameter
See http://tapestry.apache.org/tapestry4.1/components/form/form.html
On 11/9/07, Peter Stavrinides <p....@albourne.com> wrote:
> Okay I will try this.... but the question remains, shouldn't informal
> parameters render by default? according to the documentation the @Form
> component supports informal parameters.
>
> Peter
>
> Andreas Andreou wrote:
> > http://www.nabble.com/AjaxSubmit-with-confirm-t3776797.html
> >
> > dojo.event.connect(dojo.ById('link'), "onclick", function(e) { if
> > (!confirm('Are you sure?') e,preventDefault(); } );
> >
> > Do something similar for the form...
> >
> > On 11/9/07, Peter Stavrinides <p....@albourne.com> wrote:
> >
> >> From looking at the in the output it appears that the informal
> >> parameters are not being rendered on my form tag? any ideas?
> >>
> >> Peter Stavrinides wrote:
> >>
> >>> I want to run some custom JavaScript validation functions before the
> >>> submit listener is called, something like this:
> >>>
> >>> <script>
> >>> function validateForm(obj){
> >>> //checks go here
> >>> return false;
> >>> } </script>
> >>>
> >>> <form jwcid="profileForm@Form" onSubmit="return validateForm(this)"
> >>> delegate="ognl:beans.errorLog"
> >>> listener="listener:formSubmit" clientValidationEnabled=true>
> >>> </form>
> >>>
> >>> If validateForm returns false I don't want to submit, but the listener
> >>> method 'formSubmit' always seems to be called regardless, I am sure
> >>> this is very trivial but I just can't find it.
> >>>
> >>> Thanks in advance,
> >>> Peter
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 4.1.3 validation
Posted by Peter Stavrinides <p....@albourne.com>.
Okay I will try this.... but the question remains, shouldn't informal
parameters render by default? according to the documentation the @Form
component supports informal parameters.
Peter
Andreas Andreou wrote:
> http://www.nabble.com/AjaxSubmit-with-confirm-t3776797.html
>
> dojo.event.connect(dojo.ById('link'), "onclick", function(e) { if
> (!confirm('Are you sure?') e,preventDefault(); } );
>
> Do something similar for the form...
>
> On 11/9/07, Peter Stavrinides <p....@albourne.com> wrote:
>
>> From looking at the in the output it appears that the informal
>> parameters are not being rendered on my form tag? any ideas?
>>
>> Peter Stavrinides wrote:
>>
>>> I want to run some custom JavaScript validation functions before the
>>> submit listener is called, something like this:
>>>
>>> <script>
>>> function validateForm(obj){
>>> //checks go here
>>> return false;
>>> } </script>
>>>
>>> <form jwcid="profileForm@Form" onSubmit="return validateForm(this)"
>>> delegate="ognl:beans.errorLog"
>>> listener="listener:formSubmit" clientValidationEnabled=true>
>>> </form>
>>>
>>> If validateForm returns false I don't want to submit, but the listener
>>> method 'formSubmit' always seems to be called regardless, I am sure
>>> this is very trivial but I just can't find it.
>>>
>>> Thanks in advance,
>>> Peter
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 4.1.3 validation
Posted by Andreas Andreou <an...@gmail.com>.
http://www.nabble.com/AjaxSubmit-with-confirm-t3776797.html
dojo.event.connect(dojo.ById('link'), "onclick", function(e) { if
(!confirm('Are you sure?') e,preventDefault(); } );
Do something similar for the form...
On 11/9/07, Peter Stavrinides <p....@albourne.com> wrote:
> From looking at the in the output it appears that the informal
> parameters are not being rendered on my form tag? any ideas?
>
> Peter Stavrinides wrote:
> >
> > I want to run some custom JavaScript validation functions before the
> > submit listener is called, something like this:
> >
> > <script>
> > function validateForm(obj){
> > //checks go here
> > return false;
> > } </script>
> >
> > <form jwcid="profileForm@Form" onSubmit="return validateForm(this)"
> > delegate="ognl:beans.errorLog"
> > listener="listener:formSubmit" clientValidationEnabled=true>
> > </form>
> >
> > If validateForm returns false I don't want to submit, but the listener
> > method 'formSubmit' always seems to be called regardless, I am sure
> > this is very trivial but I just can't find it.
> >
> > Thanks in advance,
> > Peter
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tapestry 4.1.3 validation
Posted by Peter Stavrinides <p....@albourne.com>.
From looking at the in the output it appears that the informal
parameters are not being rendered on my form tag? any ideas?
Peter Stavrinides wrote:
>
> I want to run some custom JavaScript validation functions before the
> submit listener is called, something like this:
>
> <script>
> function validateForm(obj){
> //checks go here
> return false;
> } </script>
>
> <form jwcid="profileForm@Form" onSubmit="return validateForm(this)"
> delegate="ognl:beans.errorLog"
> listener="listener:formSubmit" clientValidationEnabled=true>
> </form>
>
> If validateForm returns false I don't want to submit, but the listener
> method 'formSubmit' always seems to be called regardless, I am sure
> this is very trivial but I just can't find it.
>
> Thanks in advance,
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org