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

    (@takayukister)

    What form-tag do you use for the radio buttons?

    Thread Starter Zmokin

    (@zmokin)

    Here is my latest form setup:

    <p>*Name: [text* name]</p>

    <p>*Address: [text* address]</p>
    <p>*City: [text* city]</p>
    <p>*Zipcode: [text* zipcode]</p>
    <p>*Phone: [tel* phone]</p>
    <p>*Email: [email* email]</p>
    <p>*Employer: [text* employer]</p>
    <p>*Occupation: [text* occupation]</p>
    <p>Donation amount: [radio donation free_text default:1 “25” “50” “100” “250” “470” “” ]</p>
    <p>[submit “Click here to process your donation”]</p>

    I originally had “Other $” for the last item, but that didn’t work so I tried leaving in blank. No change.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    It doesn’t work if the last item is blank. Make it like [radio donation free_text default:1 "25" "50" "100" "250" "470" "Other"].

    Thread Starter Zmokin

    (@zmokin)

    Please notice the last sentence of my previous post. I already tried that.

    I had tried ‘Other’ and ‘Other $’ but nothing worked.

    It is in test mode so you can try out the credit card processing to see what happens.

    Test card# 4242 4242 4242 4242
    Use any valid exp date in the future and you can use any CVV code.

    Thank you.

    Thread Starter Zmokin

    (@zmokin)

    Also, is there a way to get a ‘$’ in front of the options without having it stored as part of the value?

    In other words, so that it looks like ‘$ 25′ but stores ’25’.

    Thanks.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Sorry, but I don’t understand what you are saying.

    It is in test mode so you can try out the credit card processing to see what happens.

    Test card# 4242 4242 4242 4242
    Use any valid exp date in the future and you can use any CVV code.

    What does this mean? How is this related to the issue of the radio buttons for donation amount?

    Thread Starter Zmokin

    (@zmokin)

    The contact form is supposed to pass the selected donation amount over to the credit processing addon.

    I don’t think the ‘other’ option is working correctly because the credit card addon doesn’t work when I enter an amount in the ‘other’ option, but works correctly when I use one of the default radio button amounts.

    I was just letting you know that you could check it out using the test mode of the credit card addon just to see what happens for yourself.

    Thanks for your time.

    Thread Starter Zmokin

    (@zmokin)

    Okay, did some more playing around and figured this out, but don’t know the solution.

    If a person selects one of the preset radio button amounts, the amount is stored in the ‘donation’ field, i.e., ‘100’

    However, if a person fills in the ‘Other’ amount, such as 125, this is what happens with Contact Form 7:

    The ‘donation’ field contains ‘Other’ instead of the amount they user typed in – 125.

    The actual amount that the user typed in is stored in a completed different variable called ‘_wpcf7_radio_free_text_donation‘.

    Since the credit card payment addon is looking for the Contact Form 7 field called ‘donation’, it pulls that in, but the data stored in that field is not a number, but the word ‘Other’.

    Ergo, the credit card addon barfs.

    So the question is, how do we get the custom value that a user types in ‘_wpcf7_radio_free_text_donation’ to be transferred to the original intended field – in my example ‘donation’ when they click the submit button?

    Thanks.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    I have no idea about the add-on’s work. Why not ask for the add-on developers support?

    Thread Starter Zmokin

    (@zmokin)

    I did, but the problem lies with how Contact Form 7 handles the ‘other’ value and this would be a problem with any addon.

    Using my donation example:

    The [donation] field is the name defined in the form and mail tabs.

    This is the field name that gets passed on to whatever addon I would use if I wanted them to pull the donation value.

    However, you assign the custom value that a user enters from the ‘other’ option to a variable called ‘_wpcf7_radio_free_text_donation’.

    The variable [donation] contains ‘Other’ which obviously won’t work.

    The form logic should reverse that or somehow transfer the custom amount from ‘_wpcf7_radio_free_text_donation’ to [donation] after a person enters in the custom amount so that by the time the ‘submit’ button is clicked, the correct value is already in [donation].

    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘free_text option not working?’ is closed to new replies.