Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jpakin

    (@jpakin)

    Please don’t take this the wrong way, but I’m not going to pay for support for an edge case you didn’t consider/race condition of your creation. If anyone comes across this, I solved the problem as follows. Dev, if I’m wrong about this, feel free to correct me.

    <script>
    (function ($) {
    $(document).ready(function () {
    //hijack cff inline binding
    var form = $(‘form’), oldSubmit = form[0].onsubmit;
    form[0].onsubmit = null;
    //new binding
    form.submit(function() {
    //trigger a doc change, which will fire xhr in the plugin
    $(‘document’).trigger(‘change’);
    //when everyone is finished (DB calls retrieved), call the old binding
    $(document).ajaxStop(function() {
    oldSubmit.call(this);
    });
    });
    });
    })(jQuery);
    </script>

    Thread Starter jpakin

    (@jpakin)

    Mousedown totally worked man, really brilliant! Thank you so much!

    Thread Starter jpakin

    (@jpakin)

    I don’t need you to do anything custom. I want to better understand how cff works, and this will benefit everyone on the forum.

    When I make a field type HTML Content and it looks like this:

    <div class=”fields ” id=”field_1-14″><label for=”fieldname12_1″>Phone Number<span class=”r”>*</span></label><div class=”dfield”>
    <input id=”phone” name=”tel” class=”field large required valid” type=”tel” value=””><span class=”uh”></span>
    </div><div class=”clearer”></div></div>

    the “tel” field is POSTed back to the server.

    But when I add additional <input>’s, they are NOT POSTed back to the server, like this:
    <div class=”fields ” id=”field_1-14″><label for=”fieldname12_1″>Phone Number<span class=”r”>*</span></label><div class=”dfield”>
    <input id=”phone” name=”tel” class=”field large required valid” type=”tel” value=””>
    <input type=”hidden” id=”firstname” name=”firstname” value=””><span class=”uh”></span>
    </div><div class=”clearer”></div></div>

    Thread Starter jpakin

    (@jpakin)

    1) How come the fields I add dynamically on the client side don’t get POSTED back?
    2) However, a field I add within an HTML Code DOES get POSTED back.

    What is the difference?

    Thread Starter jpakin

    (@jpakin)

    to clarify, i am essentially adding <inputs> with static names to the form, using the dynamic values, so my server side code only ever needs to look for $_POST[“address”], not $_POST[“somedynamicid”]

    Thread Starter jpakin

    (@jpakin)

    I’m actually working on a site that has the developer version, just so you know. I can email you the name but I don’t want to type it here.

    What you wrote above KIND of works.

    There are values on the page from a previous form (like cpcff_default[1][ ‘fieldname38’ ] = ‘NY’

    The showHideDepEvent is firing BEFORE those values are assigned to their inputs, in this case to the default field value.

    I could get around this by tying to the change() event of the input, but if there is an event which TRULY fires once the form is loaded, this would be better

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