Support » Plugin: Contact Form 7 » [Plugin: Contact Form 7] Wrong values using pipes

  • Resolved frebos

    (@frebos)


    Hi,

    I’m having trouble getting the values actually inside the value tags of the form fields. Both checkboxes, radio and select doesn’t work with the pipe, for example it can look like this:

    [radio radio2 id:radio2 "Name here|142"]

    This renders me a radio button like this, and I cannot for the life of me figure out why:

    <input type="radio" name="radio2" value="Name here"> <span>Name here</span>

    Any ideas as to why this is happening? The WPCF7_USE_PIPES (or whatever it is), showed bool(true) on a var_dump().

    Edit:

    I also upgraded contact-form-7 to the latest version today as the pipes didn’t work earlier, using Wordpres 3.3.1.

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    I don’t see any trouble in your description. Apparently it is working correctly.

    Please check docs first.

    Selectable Recipient with Pipes

    This is the select I am using, however, I get the wrong value=”” for all form fields which uses pipes.

    [select Extra id:Extra class:textfield1 default:1 "Select Extra|0" "10 - 70 per month|70" "20 - 140 per month|140" "30 - per month|189" "40 - 224 per month|224" "50 - 245 per month|245"]

    Do you see anything wrong with it? Otherwise, what can cause this? Another plugin interrupting something?

    How does WPCF7 set the form field values? PHP, Javascript? Which file? Row? Any way to debug this issue?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    I don’t get it. What is the problem you think?

    The [select] tag in your last comment looks correct.

    This is what the above code generates, as you can see, it has the wrong values:

    <select name="Extra" id="Extra" class="wpcf7-form-control  wpcf7-select textfield04">
    <option value="Select Extra" selected="selected">Select Extra</option>
    <option value="10 - 70 per month">10 - 70 per month</option>
    <option value="20 - 140 per month">20 - 140 per month</option>
    <option value="30 - 189 per month">30 - 189 per month</option>
    <option value="40 - 224 per month">40 - 224 per month</option>
    <option value="50 - 245 per month">50 - 245 per month</option>
    </select>

    Any idea as to why the value doesn’t contain what’s after the “pipes”?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    No wrong values. It looks like an expected output.

    Do you understand the purpose of the pipe feature? Please read the documentation first.

    So what value do you get by using [Extra] in your mail’s message body?

    The problem is that I’d like the value=”” tag inside the option fields to be like this:

    <select name="Extra" id="Extra" class="wpcf7-form-control  wpcf7-select textfield04">
    <option value="Select Extra" selected="selected">Select Extra</option>
    <option value="10">10 - 70 per month</option>
    <option value="20">20 - 140 per month</option>
    <option value="30">30 - 189 per month</option>
    <option value="40">40 - 224 per month</option>
    <option value="50">50 - 245 per month</option>
    </select>

    Not like:
    <option value="10 - 70 per month">10 - 70 per month</option>

    So that the values are different from the text you can choose. Aren’t the pipes used for precisely that, “text|value”?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    You can’t get it by using the pipe feature.

    How about putting the HTML directly into your form or making your own module for such type of menu?

    I got my hand on the original modded plugin, which makes it work as I want it to. However, I’m not sure where this code is, and I believe it’s a “must-have” feature for your great plugin. If you could point me to a file or a function, perhaps I could find this code for you.

    Otherwise, please consider adding this to a future release, and thank you for your help.

    (We need to have this as we calculate the total sum based on all the selected values in the form, which doesn’t work with your plugin currently)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Contact Form 7] Wrong values using pipes’ is closed to new replies.