I am not a "Programmer" I am a html/css hack but I am trying to write this little jquery widget. This is not the best format for this question here, I know that, I am open to edits and reworking to make it a SO quality question. The widget jsfiddle
$(document).ready(function () {
function titleInc() {
var length = $('#title').val().length;
if (length >= 5 && length <= 10) {
return true;
// IF it already returned true, don't return true again
} else {
return false;
}
}
$('#title').blur(function () {
var current = parseInt($('#end_val').val(), 10);
if (titleInc) {
$('#end_val').val(current + 12);
}
});
});
Basically its a score keeping tool. The challenge is that if the function keeps returning true then the person gets to many points. The function is checking the char value of a input. if its between a two values the person should get the points. but they shouldn't get more if the go back to the input and retab out.
IF onchange is below/above false if onchange is in range true if onchange still is ok null
any ideas?