FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Jul 11, 2012, 4:17 AM
126 Posts

Re: Validate combination of 2 fields

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 2
There is a validator that just lets you type in javascript and return true / false so you can do what ever you like inside it.
 
<xp:inputText value="...."> 
     <xp:this.validators> 
          <xp:validateExpression message="validation failed"> 
               <xp:this.expression><![CDATA[#{javascript:
                    
                   if( < already exists > )
                   {
                        return false; // fails validation
                   } 
                   else 
                   { 
                        return true; // passes validation
                   } 
 
               }]]></xp:this.expression> 
          </xp:validateExpression> 
     </xp:this.validators> 
</xp:inputText> 

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.