Not tested code, but you can try

.tml:

<input type="text" t:type="textField" t:validate="${RadioInputChecked}" />

.java:

public String getRadioInputChecked (){
    if(RadioInputChecked)
    return "required";
    else return null;
}

-----Original Message-----
From: nquirynen [mailto:nat...@pensionarchitects.be] 
Sent: Wednesday, March 28, 2012 2:31 PM
To: users@tapestry.apache.org
Subject: Add validation conditionally

Hi,

I use the t:validate attribute to assign client side validation to a input 
field.
Now what I want to do: if a specific radio input has been checked? I need to 
add a validator to another input element. If it is unchecked the validator 
should be removed.

I can add the attribute via javascript, but this is not enough to get it to 
work (as I expected). Do I have to rerender this element with the added 
validate attribute, or is there another way to get this to work.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Add-validation-conditionally-tp5599941p5599941.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



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

Reply via email to