I have a form, I want to disable the submit function if the input's value is default.
<input id="company" name="companyname" value="company">
<input type="submit" class="button">
I tried this jquery:
$(".button").click(function(e){
if($("#company").attr('value', 'defaultValue'))
{
alert("Please fill out the contact form.");
e.preventDefault();
}
});
But it doesn't work as expected, it fires and brings up the alert as intended but also changes the value of the input to "defaultValue."
I am stumped :) What am I doing wrong?