my html:
<html>
<body>
<input type="text" id="name" name="name" placeholder="First Name" />
<label for="name">First Name </label>
<button id="submit" src="images/button.png" width="100" >Submit</button>
</body>
</html>
my script is:
<script type="text/javascript" src="jquery-1.5.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#submit').click(function() {
var emptyTextBoxes = $('input[type=text],[type=password]').filter(function() { return this.value == "";
});
emptyTextBoxes.each(function() {
$(emptyTextBoxes).nextAll('label').css({'display':'inline','color':'#F00'});
});
});
here once i entered values in the textfield i want to show message(form submitting) how can put that alert message here
Completely re-worked version which puts your input fields into a form and corrects errors in the original javascript…