You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by kawes <ra...@gmail.com> on 2008/12/15 20:49:22 UTC

[T5 5.0.18] - How to 'turn on' dynamic validation

Hi Guys, 

I have a following piece of code in my *.tml file:

<t:form>
   <input type="text" t:type="textfield" t:value="toCreate.name"
t:validate="required"/>

   <input type="submit" t:type="submit" t:id="cancelButton" value="Cancel"/>
   <input type="submit" t:type="submit" t:id="nextButton" value="Next"/>		
</t:form>
	
As you can see I added two submit buttons and a validation to a textfield.
The problem is that I would like to 'turn on' this validation only when user
clicks Next button.
Currently when the textfield is empty and Cancel button is clicked the T5
says that field cannot be empty.

Probably this is possible on server side only but maybe I am wrong.
	
Thanks in advance	
kawes
-- 
View this message in context: http://www.nabble.com/-T5-5.0.18----How-to-%27turn-on%27-dynamic-validation-tp21020626p21020626.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: [T5 5.0.18] - How to 'turn on' dynamic validation

Posted by kawes <ra...@gmail.com>.

Hi Marcus, 

thanks a lot for your response,
your suggestion is very good and is so simple.

I should have thought about that myself.

thanks again for the advice


Marcus-11 wrote:
> 
> Hi Kawes,
> There is another option, you can put the "Cancel" (submit button) in
> another
> Form.
> 
> <t:form>
>   <input type="text" t:type="textfield"
> t:value="toCreate.name" t:validate="required"/>
> 
>   <input type="submit" t:type="submit" t:id="nextButton" value="Next"/>
> </t:form>
> 
> <t:form id="cancel">
>   <input type="submit" t:type="submit" t:id="cancelButton"
> value="Cancel"/>
> </t:form>
> 
> 
> Marcus
> 
> 

-- 
View this message in context: http://www.nabble.com/-T5-5.0.18----How-to-%27turn-on%27-dynamic-validation-tp21020626p21060685.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: [T5 5.0.18] - How to 'turn on' dynamic validation

Posted by Marcus Veloso <mv...@gmail.com>.
Hi Kawes,
There is another option, you can put the "Cancel" (submit button) in another
Form.

<t:form>
  <input type="text" t:type="textfield"
t:value="toCreate.name" t:validate="required"/>

  <input type="submit" t:type="submit" t:id="nextButton" value="Next"/>
</t:form>

<t:form id="cancel">
  <input type="submit" t:type="submit" t:id="cancelButton" value="Cancel"/>
</t:form>


Marcus

Re: [T5 5.0.18] - How to 'turn on' dynamic validation

Posted by kawes <ra...@gmail.com>.
Hi, 

thanks, I did not think of that ;)


Howard Lewis Ship wrote:
> 
> The accepted approach is to use an ActionLink for the cancel button.
> You can use CSS to style it like a submit button.
> 
> On Mon, Dec 15, 2008 at 11:49 AM, kawes <ra...@gmail.com> wrote:
>>
>> Hi Guys,
>>
>> I have a following piece of code in my *.tml file:
>>
>> <t:form>
>>   <input type="text" t:type="textfield" t:value="toCreate.name"
>> t:validate="required"/>
>>
>>   <input type="submit" t:type="submit" t:id="cancelButton"
>> value="Cancel"/>
>>   <input type="submit" t:type="submit" t:id="nextButton" value="Next"/>
>> </t:form>
>>
>> As you can see I added two submit buttons and a validation to a
>> textfield.
>> The problem is that I would like to 'turn on' this validation only when
>> user
>> clicks Next button.
>> Currently when the textfield is empty and Cancel button is clicked the T5
>> says that field cannot be empty.
>>
>> Probably this is possible on server side only but maybe I am wrong.
>>
>> Thanks in advance
>> kawes
>> --
>> View this message in context:
>> http://www.nabble.com/-T5-5.0.18----How-to-%27turn-on%27-dynamic-validation-tp21020626p21020626.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
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> 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/-T5-5.0.18----How-to-%27turn-on%27-dynamic-validation-tp21020626p21038258.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: [T5 5.0.18] - How to 'turn on' dynamic validation

Posted by Howard Lewis Ship <hl...@gmail.com>.
The accepted approach is to use an ActionLink for the cancel button.
You can use CSS to style it like a submit button.

On Mon, Dec 15, 2008 at 11:49 AM, kawes <ra...@gmail.com> wrote:
>
> Hi Guys,
>
> I have a following piece of code in my *.tml file:
>
> <t:form>
>   <input type="text" t:type="textfield" t:value="toCreate.name"
> t:validate="required"/>
>
>   <input type="submit" t:type="submit" t:id="cancelButton" value="Cancel"/>
>   <input type="submit" t:type="submit" t:id="nextButton" value="Next"/>
> </t:form>
>
> As you can see I added two submit buttons and a validation to a textfield.
> The problem is that I would like to 'turn on' this validation only when user
> clicks Next button.
> Currently when the textfield is empty and Cancel button is clicked the T5
> says that field cannot be empty.
>
> Probably this is possible on server side only but maybe I am wrong.
>
> Thanks in advance
> kawes
> --
> View this message in context: http://www.nabble.com/-T5-5.0.18----How-to-%27turn-on%27-dynamic-validation-tp21020626p21020626.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
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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