semantic.js
function(value, identifier) {
      var
        $form = $(this),
        matchingValue
      ;
      if( $('[data-validate="'+ identifier +'"]').length > 0 ) {
        matchingValue = $('[data-validate="'+ identifier +'"]').val();
      }
      else if($('#' + identifier).length > 0) {
        matchingValue = $('#' + identifier).val();
      }
      else if($('[name="' + identifier +'"]').length > 0) {
        matchingValue = $('[name="' + identifier + '"]').val();
      }
      else if( $('[name="' + identifier +'[]"]').length > 0 ) {
        matchingValue = $('[name="' + identifier +'[]"]');
      }
      return (matchingValue !== undefined)
        ? ( value.toString() == matchingValue.toString() )
        : false
      ;
    }
function(value, identifier) {
      var
        $form = $(this),
        matchingValue
      ;
      if( $('[data-validate="'+ identifier +'"]').length > 0 ) {
        matchingValue = $('[data-validate="'+ identifier +'"]').val();
      }
      else if($('#' + identifier).length > 0) {
        matchingValue = $('#' + identifier).val();
      }
      else if($('[name="' + identifier +'"]').length > 0) {
        matchingValue = $('[name="' + identifier + '"]').val();
      }
      else if( $('[name="' + identifier +'[]"]').length > 0 ) {
        matchingValue = $('[name="' + identifier +'[]"]');
      }
      return (matchingValue !== undefined)
        ? ( value.toString() == matchingValue.toString() )
        : false
      ;
    }
function ( value , identifier ) { var $form = $ ( this ) , matchingValue ; if ( $ ( '[data-validate="' + identifier + '"]' ) . length > 0 ) { matchingValue = $ ( '[data-validate="' + identifier + '"]' ) . val ( ) ; } else if ( $ ( '#' + identifier ) . length > 0 ) { matchingValue = $ ( '#' + identifier ) . val ( ) ; } else if ( $ ( '[name="' + identifier + '"]' ) . length > 0 ) { matchingValue = $ ( '[name="' + identifier + '"]' ) . val ( ) ; } else if ( $ ( '[name="' + identifier + '[]"]' ) . length > 0 ) { matchingValue = $ ( '[name="' + identifier + '[]"]' ) ; } return ( matchingValue !== undefined ) ? ( value . toString ( ) == matchingValue . toString ( ) ) : false ; }
matches another field
matches another field