I applied the following code to the textarea.php file and the onfocus/onblur functionality works but now the field only allows one line of text in the middle of the box, instead of multiple lines starting at the top of the box, as if it were a text input instead of textarea input.
Here is the code I used plus a little of what comes just before it and just after for reference:
if ( ! empty( $content ) ) $value = $content; } // Default value disappears onfocus, reappears onblur if still empty $html = '<input type="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=\'' . esc_attr( $value ) . '\';" </textarea>'; $validation_error = ''; if ( is_a( $wpcf7_contact_form, 'WPCF7_ContactForm' ) )
Any help would be much appreciated!
- The topic ‘[Plugin: Contact Form 7] textarea input is wrongly functioning as text input’ is closed to new replies.