perfectheat
Apr 13th, 2010, 01:32 PM
Hello. I have a problem with a form and it's predefined input values.
The problem is that when I write something in a field and, goes on to the next field, but then goes back to any filled in fields it just resets it to the predefined value. It's the same with the text area.
<form action="send-email.php" method="post" id="contact-form">
<input name="name" id="fname" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Name':this.value;" value="Name" type="text">
<input name="email" id="email" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'E-mail':this.value;" value="E-mail" type="text">
<textarea name="details" id="details" rows="20" cols="40" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Query':this.value;" value="Query">Query</textarea>
<input onclick="sendEmail()" value="" class="button" type="button">
</form>
Thank you for looking at my messy code. I'm very new to this.
Regards,
M.
The problem is that when I write something in a field and, goes on to the next field, but then goes back to any filled in fields it just resets it to the predefined value. It's the same with the text area.
<form action="send-email.php" method="post" id="contact-form">
<input name="name" id="fname" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Name':this.value;" value="Name" type="text">
<input name="email" id="email" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'E-mail':this.value;" value="E-mail" type="text">
<textarea name="details" id="details" rows="20" cols="40" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Query':this.value;" value="Query">Query</textarea>
<input onclick="sendEmail()" value="" class="button" type="button">
</form>
Thank you for looking at my messy code. I'm very new to this.
Regards,
M.