Custom Form Validation

So far loving knack but stuck on one issue which would love help with

I have used the

Custom Form Validation

$(document).on('knack-view-render.view_1', function(event, view, data) {

$("#view_1 .kn-submit input[type=submit]").on("click", function() {

if ($("#view_1-field_2").val() != "SpecificValue") {

alert ("These are not the droids you are looking for.");

return false;




I am wanting to modify this slightly to say something like

If "#view_1-field_2" does not contain the same value as "#view_1-field_3" then provide alert.

Any support would be appreciated