You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by devilabit <tj...@gmail.com> on 2008/08/12 18:26:32 UTC

Cant get FromFragment to skip server side validation

I am having trouble getting FormFragment to skip server side validation for a
simple example I created.  The FormFragment is not visible and it has one
textfield that has a required validator. eg.

<t:formfragment t:id="testfrag" visible="false">
	<h2>test field</h2>
        <t:textfield t:id="testField" t:value="testValue"
t:validate="required" />
</t:formfragment>

Is there something simple im missing?  I tired with both clientValidation on
and off.  My source seems to have the t:formdata hidden field but I cant see
where this gets removed by tapestry prior to submit.

Any suggestions would be welcome.

Thanks.

-- 
View this message in context: http://www.nabble.com/Cant-get-FromFragment-to-skip-server-side-validation-tp18947864p18947864.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Cant get FromFragment to skip server side validation

Posted by devilabit <tj...@gmail.com>.
I have had some time to revisit the form fragment today.  It seems that for a
hidden form fragment section to bypass server side validation client side
validation MUST be enabled.

Is there any way to get a hidden form fragment with required fields to
bypass server side validation on submit?

It may seem strange to have hidden fields required but as well as using the
t:validate="required" for validation I am also using the required property
to render fields with a required field marker.

Any suggestions would be appreciated.


devilabit wrote:
> 
> What I have is a large form with some sections visible and some sections
> hidden.  The hidden sections are triggered visible by mixin.  For example
> I have a mixin on an amount field that requires a hidden section to be
> made visible if the amount is above a certain threshold.  This is done by
> having an ajax request fired after a blur on the amount field and then if
> the threshold is breached the server will respond with a JSON update that
> will set the form fragment to visible.
> 
> So when the form fragment section is hidden I dont want server side
> validation for any of its fields but when the from fragment is visible i
> want each field that is marked as required to have sever side validation
> applied on submit.
> 
> 
> 
> Robert Zeigler wrote:
>> 
>> Maybe telling us a bit more about your use case would help.   
>> Generally, if you have t:validate="required", it would be safe to  
>> assume that you /want/ server-side validation, since relying on client- 
>> side validation is insecure.  But maybe you're trying to write a  
>> cancel button or something?
>> 
>> Robert
>> 
>> On Aug 12, 2008, at 8/1211:26 AM , devilabit wrote:
>> 
>>>
>>> I am having trouble getting FormFragment to skip server side  
>>> validation for a
>>> simple example I created.  The FormFragment is not visible and it  
>>> has one
>>> textfield that has a required validator. eg.
>>>
>>> <t:formfragment t:id="testfrag" visible="false">
>>> 	<h2>test field</h2>
>>>        <t:textfield t:id="testField" t:value="testValue"
>>> t:validate="required" />
>>> </t:formfragment>
>>>
>>> Is there something simple im missing?  I tired with both  
>>> clientValidation on
>>> and off.  My source seems to have the t:formdata hidden field but I  
>>> cant see
>>> where this gets removed by tapestry prior to submit.
>>>
>>> Any suggestions would be welcome.
>>>
>>> Thanks.
>>>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Cant-get-FromFragment-to-skip-server-side-validation-tp18947864p18947864.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Cant-get-FromFragment-to-skip-server-side-validation-tp18947864p19066178.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Cant get FromFragment to skip server side validation

Posted by devilabit <tj...@gmail.com>.
What I have is a large form with some sections visible and some sections
hidden.  The hidden sections are triggered visible by mixin.  For example I
have a mixin on an amount field that requires a hidden section to be made
visible if the amount is above a certain threshold.  This is done by having
an ajax request fired after a blur on the amount field and then if the
threshold is breached the server will respond with a JSON update that will
set the form fragment to visible.

So when the form fragment section is hidden I dont want server side
validation for any of its fields but when the from fragment is visible i
want each field that is marked as required to have sever side validation
applied on submit.



Robert Zeigler wrote:
> 
> Maybe telling us a bit more about your use case would help.   
> Generally, if you have t:validate="required", it would be safe to  
> assume that you /want/ server-side validation, since relying on client- 
> side validation is insecure.  But maybe you're trying to write a  
> cancel button or something?
> 
> Robert
> 
> On Aug 12, 2008, at 8/1211:26 AM , devilabit wrote:
> 
>>
>> I am having trouble getting FormFragment to skip server side  
>> validation for a
>> simple example I created.  The FormFragment is not visible and it  
>> has one
>> textfield that has a required validator. eg.
>>
>> <t:formfragment t:id="testfrag" visible="false">
>> 	<h2>test field</h2>
>>        <t:textfield t:id="testField" t:value="testValue"
>> t:validate="required" />
>> </t:formfragment>
>>
>> Is there something simple im missing?  I tired with both  
>> clientValidation on
>> and off.  My source seems to have the t:formdata hidden field but I  
>> cant see
>> where this gets removed by tapestry prior to submit.
>>
>> Any suggestions would be welcome.
>>
>> Thanks.
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Cant-get-FromFragment-to-skip-server-side-validation-tp18947864p18947864.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Cant-get-FromFragment-to-skip-server-side-validation-tp18947864p18953952.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Cant get FromFragment to skip server side validation

Posted by Robert Zeigler <ro...@scazdl.org>.
Maybe telling us a bit more about your use case would help.   
Generally, if you have t:validate="required", it would be safe to  
assume that you /want/ server-side validation, since relying on client- 
side validation is insecure.  But maybe you're trying to write a  
cancel button or something?

Robert

On Aug 12, 2008, at 8/1211:26 AM , devilabit wrote:

>
> I am having trouble getting FormFragment to skip server side  
> validation for a
> simple example I created.  The FormFragment is not visible and it  
> has one
> textfield that has a required validator. eg.
>
> <t:formfragment t:id="testfrag" visible="false">
> 	<h2>test field</h2>
>        <t:textfield t:id="testField" t:value="testValue"
> t:validate="required" />
> </t:formfragment>
>
> Is there something simple im missing?  I tired with both  
> clientValidation on
> and off.  My source seems to have the t:formdata hidden field but I  
> cant see
> where this gets removed by tapestry prior to submit.
>
> Any suggestions would be welcome.
>
> Thanks.
>
> -- 
> View this message in context: http://www.nabble.com/Cant-get-FromFragment-to-skip-server-side-validation-tp18947864p18947864.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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