WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Need some help with Radio buttons.. (1 post)

  1. murrydan
    Member
    Posted 3 years ago #

    I am using CF7 radio buttons with a CSS style switcher, when you choose a radio, it triggers a style sheet to populate images. The style switcher requires an ID to trigger, I am using the $value as the ID, but there may be spaces, and that is no good.. So I tried some regex to reformat of the $value, but that doesn't pass in the email.

    Here is a sample from my plugins/contact-form-7/modules/checkbox.php starting around line 120

    if ( $label_first ) { // put label first, input last
    			$item = '<div class="art"><span class="wpcf7-list-item-label ' . esc_attr(  $value ) . '">' . esc_html( $label ) . '</span>&nbsp;';
    			$item .= '<input type="' . $input_type . '" name="' . $name . ( $multiple ? '[]' : '' ) . '"onClick="chooseStyle(this.value, 60)" value="' . esc_attr(   $value ) . '"' . $checked . $tabindex . $onclick . ' />';
    		} else {
    			$item = '<div class="art"><input type="' . $input_type . '" name="' . $name . ( $multiple ? '[]' : '' ). '" onClick="chooseStyle(this.value, 60)" value="' . esc_attr( preg_replace($pattern, $replacement, $value) ) . '"' . $checked . $tabindex . $onclick . ' />';
    			$item .= '&nbsp;<span class="wpcf7-list-item-label ' . esc_attr(  preg_replace($pattern, $replacement, $value) ) . '">' . esc_html( $label ) . '</span>' . '<br /><a class="' . esc_attr( preg_replace($pattern, $replacement, $value) ) . ' sample" href="#" rel="#' . esc_attr( preg_replace($pattern, $replacement, $value) ) . '">' . '</a></div>';
    		}

    Question is, is there a way to create classes and IDs with "-"s and pass the $value in the email without?

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic