<commit_before>ClientSideValidations.validators.remote['different'] = function(element, options) {
    if ($.ajax({
        url: '/validators/different',
        data: { value: element.val(), than: ClientSideValidations.helpers.getSiblingField(element, options.than).val() },
        async: false
    }).status == 404) { return options.message; }
};<commit_msg>Client side implementation of "different" validator.<commit_after>// Define the trim function if it's not already defined.
// See http://stackoverflow.com/a/1418059 for more info
if (typeof(String.prototype.trim) === "undefined") {
    String.prototype.trim = function () {
        return String(this).replace(/^\s+|\s+$/g, '');
    };
}

ClientSideValidations.validators.remote['different'] = function (element, options) {
    var value = element.val(),
        otherValue = ClientSideValidations.helpers.getSiblingField(element, options.than).val();
    if (value.trim() == otherValue.trim()) {
        return options.message;
    }
};
{'fraction_non_alphanumeric': 0.15731462925851702, 'fraction_numerical': 0.01002004008016032, 'mean_word_length': 3.8970588235294117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '413283', 'n_tokens_mistral': 295, 'n_tokens_neox': 285, 'n_words': 61}