This is my html button code
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" name="name" />
<div class="help-block with-errors" style="font-size:12pt">Input Only Alphabet</div>
</div>
<input class="btn btn-primary" type="submit" value="SUBMIT" id="button1 style="height:50px; width:100px" />
This is my jQuery
<script type="text/javascript">
$("#button1").click(function(){
if($("#name").val() == null)
alert("haha");
if($("#name").val() == [a-z])
alert("zzzz");
});
</script>
My problem is i only can validate the first condition. Everytime i try 2nd condition it wont work. Anyone can help see what is my problem??