Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter abelonger

    (@abelonger)

    Because of fields like this:

    [select* player-jersey-one id:player-jersey-one include_blank “Adult XS|37.50” “Adult SM|37.50” “Adult M|37.50” “Adult LG|37.50” “Adult XL|37.50” “Adult XXL|37.50” “N/A|0.00”]

    With the value of 37.50 used for multiple options and passed to my payment plugin, I don’t know what is actually being selected without also storing the first part.

    • This reply was modified 2 years, 5 months ago by abelonger.
    Thread Starter abelonger

    (@abelonger)

    I have been doing this for a number of years at this point without issue. Is there a different/better way I should be storing both values?

    Thread Starter abelonger

    (@abelonger)

    I have a couple contact form database plugins that won’t store both the name and the value selected for those dropdowns – so for example, if the user selects “Adult SM” for the player-jersey-one field, it will store “37.50”. But since that value is actually on a few of the selections, I wouldn’t know which one was truly selected. So I use a hidden field to store the first part of the pipe.

    I am using a handful of plugins related to the contact forms – ACF7 DB User Access, Advanced CF7 DB, CF7 Skins, Conditional Fields for Contact Form 7, Paypal & Stripe Add-on, and Contact Form DB. My theme is a relatively old one that is no longer in development. Has anything changed recently with the id: option?

    Thread Starter abelonger

    (@abelonger)

    Here is a snippet of the form – I use the hidden fields to store the first value in a separate form field. This allows me to use those fields in the e-mail as well as actually store them in the database (otherwise it is only storing the selected value).

    <div>
        <div class="half last">Jersey #1 Size *[select* player-jersey-one id:player-jersey-one include_blank "Adult XS|37.50" "Adult SM|37.50" "Adult M|37.50" "Adult LG|37.50" "Adult XL|37.50" "Adult XXL|37.50" "N/A|0.00"]</div>
        <div class="half last">Jersey #2 Size *[select* player-jersey-two id:player-jersey-two include_blank "Adult XS|37.50" "Adult SM|37.50" "Adult M|37.50" "Adult LG|37.50" "Adult XL|37.50" "Adult XXL|37.50" "N/A|0.00"]</div>
    </div>
    <div>
        <div class="half">Helmet Size *[select* player-helmet id:player-helmet include_blank "Junior (SM)|70.00" "Senior (LG)|70.00" "N/A|0.00"]</div>
        <div class="half last">Pants Size *[select* player-pants id:player-pants include_blank "Child SM|35.00" "Child M|35.00" "Child LG|35.00" "Child XL|35.00" "Adult XS|35.00" "Adult SM|35.00" "Adult M|35.00" "Adult LG|35.00" "Adult XL|35.00" "Adult XXL|35.00" "N/A|0.00"]</div>
    </div>
    <div>
        <div class="half">Payment Type *[select* player-payment-type id:player-payment-type include_blank "Paypal|1" "Check|0"]</div>
    </div>
    
    [hidden hidden-player-helmet id:hidden-player-helmet]
    [hidden hidden-player-jersey-one id:hidden-player-jersey-one]
    [hidden hidden-player-jersey-two id:hidden-player-jersey-two]
    [hidden hidden-player-pants id:hidden-player-pants]
    
    [hidden hidden-player-payment-type id:hidden-player-payment-type]
    

    I did find info in the documentation about using [_raw_{field name}] but I suspect that would only be for the e-mail and wouldn’t actually store the value in the database, is that correct?

    Thread Starter abelonger

    (@abelonger)

    Pretty straightforward script to set some hidden fields (I have some pricing dropdowns that have similar number values but different descriptions that I have to save separately)

    jQuery(document).ready(function() {
        jQuery('[id^="player-"]').each(function() {
            if(jQuery(this).val() != "")
            {
                setValue(this);
            }
        });
    });
    jQuery(function() {
        jQuery('[id^="player-"]').change(function() {
            setValue(this);
        });
    });
    function setValue(dropdown)
    {
        var selectId = '#hidden-' + jQuery(dropdown).attr('id');
        var value = jQuery(dropdown).val();
        jQuery(selectId).val(value);
    }

    I was able to get it working again by referencing the name attribute instead – but I am curious if the removal of the ID was intentional or not (or if I can add it back with a different change in the form)

    Thread Starter abelonger

    (@abelonger)

    Thanks so much for the quick turnaround!

    Thread Starter abelonger

    (@abelonger)

    I just get a white screen with the URL showing “?cf7pp_redirect=6”

    Dev tools console shows “SCRIPT16389: Unspecified error.” on file “polyfill (1,10884)” – the file URL shows as: ms-browser-extension://autoformfill/ms-browser-extension:/autoformfill_5ed10d46bd7e47deb1f3685d2c0fce08/polyfill

    Thread Starter abelonger

    (@abelonger)

    Perfect – thanks so much for the quick response and turnaround on updating the plugin!

Viewing 8 replies - 1 through 8 (of 8 total)