I am trying to erase the the form fields when you click on them so the value displays then erase on focus.
Currently I have the input fields working by editing the modules/text.php file but i cant for the life of me get the textfield work with on focus.
this is what i have in the textarea.php
$html = '<textarea name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' onfocus="if(this.value==\'';
$html = $html . esc_attr( $value ) . '\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'' . '\';" </textarea>';
it almost works, apart for some reason it adds this tag ">" just before the closing textarea like this
<textarea onblur="if(this.value=='') this.value='';" onfocus="if(this.value=='Your Message') this.value='';" rows="4" cols="15" class="wpcf7-validates-as-required" id="mf_message" value="Your Message" name="your-message"></textarea>
I dont know too much about php but I dont know why it adds this tag and I think this is why its not working.
Any thoughts?
Cheers