luminateExtend.js - Add recurring option

Options
Hey guys,



I've been using Noah Coopers luminateExtend project and have a little form that is working (with Noah's help I might add!). I'm not very good with js nor api's, but I've been given this project and need to see it through. My hang up now is that I don't know how to give the users a monthly recurring gift option. See the form as it is now: http://www.upbring.org/give Keep in mind the form is active and working, just not the monthly gift check box.



So my questions is: How can I hook up that check box to my luminate shadow form through luminateExtend.js? I have the Flexible Sustainer Donation Level part added to my form and configured properly (I hope!). I'm just not sure how to set up my checkbox to push that info back to the form.



Any help is appreciated!

Tagged:

Comments

  • It's just a matter of adding the level_autorepeat checkbox and passing two values back to the API if it's checked.



    From open.convio.com:

    Sustaining (Recurring) Gifts

    Sustainer giving lets donors set up recurring, automatic gifts, with either pre-set amounts and durations or flexible donor-specified commitments. Use the sustaining.frequency and sustaining.duration parameters to make sustaining donations. The shadow donation form must contain one of the sustaining giving donation level elements.



    So something like this if you build your API Params in code...


    var level_autorepeat = donation_form.elements['level_autorepeat'].checked;
    if (level_autorepeat) apiParameters += '&sustaining.frequency=monthly'; // Our only option.
    if (level_autorepeat) apiParameters += '&sustaining.duration=0'; // 0 means forever

    EDIT:



    Or with your form, I think you'll just add two inputs for these values, and populate them either using a script if they are hidden or by simply revealing them to the user if the checkbox was checked.



    <select id="sustaining.frequency" name="sustaining.frequency">

    <option value="">(Choose One)</option>

    <option value="monthly">Monthly</option>

    <option value="quarterly">Quarterly</option>

    </select>

    <select id="sustaining.duration" name="sustaining.duration">

    <option value="">(Choose One)</option>

    <option value="4">4</option>

    <option value="12">12</option>

    <option value="0">Forever</option>

    </select>

  • Brian Mucha:

    EDIT:



    Or with your form, I think you'll just add two inputs for these values, and populate them either using a script if they are hidden or by simply revealing them to the user if the checkbox was checked.



    <select id="sustaining.frequency" name="sustaining.frequency">

    <option value="">(Choose One)</option>

    <option value="monthly">Monthly</option>

    <option value="quarterly">Quarterly</option>

    </select>

    <select id="sustaining.duration" name="sustaining.duration">

    <option value="">(Choose One)</option>

    <option value="4">4</option>

    <option value="12">12</option>

    <option value="0">Forever</option>

    </select>

    Brian,

    Thanks for your response and sorry for the delay in getting back with you. I ammended what you suggested and tested it and the gift went through. Here is the code I'm using:

    <input class="checkbox" id="sustaining.frequency" name="sustaining.frequency" type="checkbox" value="monthly" />



    I assume then that the gift is now set up to be a monthly recurring gift. However, I can't seem to find anywhere in Luminate where I would verify that. The only thing I've found is in my Constituent Profile there is a Sustaining Gift section and there is no data in those fields. Have I done something wrong or have I missed a step?



    Thanks again!

Categories