I have a statement like this:
I have already double checked the ids of the related html elements. If I remove the if statement everything works ok. Do you have any idea why does not it work?
<script type="text/javascript">
$(document).ready(function() {
$("#ok").click(function() {
$('#ok').attr('disabled', 'disabled');
//global vars
var ad = $("#ad").val().length;
If (ad < 6) {
alert("you must enter a higher value");
}
});
});
</script>
I’m guessing either you should lowercase your “if”. The problem is obviously not a type-related issue.
And to clarify via a comment on the question and an answer below:
should be
This is the case because Javascript is case-sensitive. I would very much like to thank all who were involved in this and I hope there is no more confusion about anything related to this issue.