Custom HTML - Javascript - check if two text fields are the same
Confluence User - 28 Apr, 2016
Hi Masters,
I have a question, I would like to check if two text fields are the same.
If they are the same, then in the field "check" I would like to see "YES". I was trying to write some javascript but without success. Can you have a look into this one please?
Field:
status_current
status_new
check
APP_TEST_COPY-1-20160427174736.jwa
<script>
$(document).ready(function(){
$('input[name="status_current"], input[name="status_new"]').change( function(){
d1 = $('input[name="status_current"]').val();
d2 = $('input[name="status_new"]').val();
diff = "NO";
if (d1 == d2) {
diff = "YES";
}
$('input[name=check]').val(diff);
});
});
</script>
javascript;forms
