Forums

[Plugin: Contact Form 7] Formatting checkbox sets (4 posts)

  1. ontargetpro
    Member
    Posted 3 months ago #

    I have a website planner form here: http://www.ontargetpro.com/wordpress/?page_id=34 I don't like the way the checkboxes are no separated with line breaks. Is there any way to change this without making a new field for each option? Thanks!

  2. finedesignz
    Member
    Posted 3 months ago #

    I didn't either... I wish they'd just fix the plugin.
    Edit this plugin file here using the plugin editor:
    contact-form-7/modules/checkbox.php

    About 3/4 of the way down, you'll see this:

    if ( $label_first ) { // put label first, input last
    			$item = '<span class="wpcf7-list-item-label">' . esc_html( $label ) . '</span>&nbsp;';
    			$item .= '<input type="' . $input_type . '" name="' . $name . ( $multiple ? '[]' : '' ) . '" value="' . esc_attr( $value ) . '"' . $checked . $onclick . ' />';
    		} else {
    			$item = '<input type="' . $input_type . '" name="' . $name . ( $multiple ? '[]' : '' ) . '" value="' . esc_attr( $value ) . '"' . $checked . $onclick . ' />';
    			$item .= '&nbsp;<span class="wpcf7-list-item-label">' . esc_html( $label ) . '</span><br />';
    		}

    The <br /> tag is what I added, after </span> and before the end quote.

  3. hellosnitty
    Member
    Posted 2 months ago #

    you dont need to do all of that.
    if you go into your css files for Contact 7 do this:
    go to plugins, under Contact 7, there is an edit field, click that and go to your css files.
    Click on stylesheet.css
    in the next to the last code block...shouldlook like this...
    }
    span.wpcf7-list-item {
    margin-left: 0.5em;
    }

    Change it to look like this:

    }
    span.wpcf7-list-item {
    margin-left: 0.5em;
    display: block;
    }

    thats it, save and youre done. very easy fix but they should have that already done. I think it looks like crap aligned that way
    HTH

  4. ljkerley
    Member
    Posted 1 month ago #

    I am jumping into the conversation because I have a related issue. I would like to apply a style class to the input tags <input>.
    I could generate entirely new tags but that seems like extra work. i would gladly add to my style sheet but I need someway to specify c-f-7 form elements. Do you have a tip on how I can do that? I looked at the plug-in code and couldn't find the form name. (I tried some obvious ones but they didn't work.)

Reply

You must log in to post.

About this Topic