• Resolved Tim Priebe

    (@timjpriebe)


    Brief background: I have a client I’m making an iPhone-optimized website for. I’ve always used CF7 for all my sites, but for this project I need it to output email inputs as type “email”.

    In text.php, I’ve changed this line:

    $html = '<input type="text" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' />';

    …to this:

    if ( 'email' == $type || 'email*' == $type )
                $html = '<input type="email" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' />';
            else
                $html = '<input type="text" name="' . $name . '" value="' . esc_attr( $value ) . '"' . $atts . ' />';

    But apparently it checks that string somewhere, as it’s not showing that field at all now.

    Any idea what other code I would need to modify to accomplish this for this one project?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tim Priebe

    (@timjpriebe)

    Wow, apparently that one change totally hosed my installation of CF7. Even after I’ve changed the code back, email forms won’t appear. I’ve deactivated, manually dropped the table, deleted the plugin, then reinstalled. Same problem.

    Any ideas on how to fix?

    Thread Starter Tim Priebe

    (@timjpriebe)

    Apparently I’m crazy. I just wanted to let anyone reading this know that the hack actually did work, and all my problems were related to a bit of jQuery code I’d forgotten to delete. The email fields are now of type email, which means they show the appropriate keyboard on iPhone.

    Sorry for any confusion, and hope this helps someone.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Contact Form 7] Trying to add input of type email to mobile site’ is closed to new replies.