WordPress.org

Support

Support » Plugins and Hacks » Undefined index after posting when JavaScript is disabled

Undefined index after posting when JavaScript is disabled

  • Hello,

    I was testing my form with JavaScript disabled, and got a PHP error saying “Undefined index” for my hidden field, using this plugin. The error came from this line, and looking at the $_POST array at that point, it only had the initial four WPCF7 fields.

    I fixed the error by changing the if condition from:
    if ( wpcf7_is_posted() )
    To:
    if ( wpcf7_is_posted() && isset( $_POST[$name] ) )

    This is the check that the Contact Form 7 plugin does for text fields, see this line.

    Might this be a fix that should be included in the next version of your plugin, or was something else broken on my side to begin with?

    http://wordpress.org/extend/plugins/contact-form-7-modules/

  • The topic ‘Undefined index after posting when JavaScript is disabled’ is closed to new replies.