Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ournewhero

    (@ournewhero)

    for anyone interested in this, i edited form-display.php, and added the onFocus element when the form is created.

    mine now looks like this:

    case 'input' :
    
                                            $class = 'input ';
                                            $class .= ( $field_vars['fieldrequired'] == '1' ) ? 'required-field ' : '';
                                            $class .= ( $field_vars['fieldvalidation'] != 'none' ) ? 'validate-' . $field_vars['fieldvalidation'] : '';
                                            $class = rtrim( $class );
                                            $default_value = ( $submitted_value != null ) ? $submitted_value : $field_vars['fieldoptions'];
    
                                            $form .= '<li>'
                                                    . ( ( $show_label ) ? '<label for="' . $field_id . '">' . $field_vars['fieldname'] . '</label>' : '' )
                                                    . '<input type="' . $input_type . '" name="' . $field_id . '" id="' . $field_id . '" value="' . $default_value . '"onfocus="this.value==this.defaultValue?this.value=\'\':null" class="' . $class . '" />'
                                                    . ( ( $field_error != null ) ? $field_error : '' )
                                                    . '</li>';
                                            break;

    @ ournewhero That’s excellent! I need to solve the same problem. One thing though, how do you remove the Message box (Text Input Multi line)
    I’ve tried to add the

    ‘”onfocus=”this.value==this.defaultValue?this.value=\’\’:null

    case 'textarea' :
    
    					$class = '';
    					$class .= ( $field_vars['fieldrequired'] == '1' ) ? 'required-field ' : '';
    					$class .= ( $field_vars['fieldvalidation'] != '' ) ? 'validate-' . $field_vars['fieldvalidation'] : '';
    					$class = rtrim( $class );
    					$default_value = ( $submitted_value != null ) ? $submitted_value : $field_vars['fieldoptions'];
    
    					$form .= '
    <li>'
    						. ( ( $show_label ) ? '<label for="' . $field_id . '">' . $field_vars['fieldname'] . '</label>' : '' )
    						. '<textarea name="' . $field_id . '" id="' . $field_id . '" rows="10" cols="50" class="' . $class . '">' . $default_value . '</textarea>'
    						. ( ( $field_error != null ) ? $field_error : '' )
    						. '</li>
    ';

    around the default area but my site breaks no matter how I try to simplify it. Can ya help there? Are you able to make the message input text disappear as well?

    Thanks again, You are stellar!

    I hope the author will implement this in the next versions.

    Thread Starter ournewhero

    (@ournewhero)

    case 'textarea' :
    
    					$class = '';
    					$class .= ( $field_vars['fieldrequired'] == '1' ) ? 'required-field ' : '';
    					$class .= ( $field_vars['fieldvalidation'] != '' ) ? 'validate-' . $field_vars['fieldvalidation'] : '';
    					$class = rtrim( $class );
    					$default_value = ( $submitted_value != null ) ? $submitted_value : $field_vars['fieldoptions'];
    
    					$form .= '<li>'
    						. ( ( $show_label ) ? '<label for="' . $field_id . '">' . $field_vars['fieldname'] . '</label>' : '' )
    						. '<textarea name="' . $field_id . '" id="' . $field_id . '" rows="10" cols="50" class="' . $class . '" onfocus="this.value==this.defaultValue?this.value=\'\':null" >' . $default_value . '</textarea>'
    						. ( ( $field_error != null ) ? $field_error : '' )
    						. '</li>';
    					break;
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘disappearing text’ is closed to new replies.