I’m using remy sharp’s hint plugin.
<input type="text" title="hint" name="names" class="input" />
But when I post the form without filling the fields, input still has
$_POST['names'] = 'hint';
How can I prevent this issue?
Thanks in advance.
EDIT : jQuery Code:
$(".input").hint();
$(".lSubmit").click(function(e){
e.preventDefault();
$.post('form.php',decodeURIComponent($("#forms").serialize()) , function(data) {
$('.result').html(data);
});
});
The plugin removes the hint itself when the form the input is in gets submitted, unfortunately you are not submitting the form, but posting it via
$.post.The most simple way would probably to check the value(s) of the input(s) just before it gets submitted against its title, and clear it if they are the same: