Suppose,
valueChangeListener="BB.txtChngLsnr1" id="inputText1" for 1st inputText
valueChangeListener="BB.txtChngLsnr1" id="inputText2" for 2nd inputText

then,
txtChngLsnr1(ValueChangeEvent vce){
if(vce.getNewValue=null){
return; // optional case
}

if(inputText2.getValue== null){
// 
/*
*
*error code
*/
FacesContext.getCurrentInstance().renderResponse();
}
}
Similarly the code for the second value change listener can be.
txtChngLsnr2(ValueChangeEvent vce){

if(vce.getNewValue==null){

return; // optional case

}



if(inputText1.getValue== null){

// 

/*

*

*error code

*/

FacesContext.getCurrentInstance().renderResponse();

}

}

see if this works, and tell if any problem comes.

--- On Mon, 27/4/09, C Chang <[email protected]> wrote:

From: C Chang <[email protected]>
Subject: [Trinidad]How to do dynamic form validation?
To: [email protected]
Date: Monday, 27 April, 2009, 2:30 PM


Dear all,
I have a form which has two <tr:inputText> elements, if first element has 
value, then the second element must have value as well. If first element 
doesn't have value, then the second element is optional.


Vice versa, if the second element has value, then the first element must have 
value. If the second element doesn't have value, then the first element is 
optional.
How can I implement this in trinidad? Thanks in advance!

Kind regards,Leon




      Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! 
Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox

Reply via email to