PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

gform_[admin_]pre_render and/or gform_after_submission problem

  1. Hi,

    Using Gravityforms v1.6.3.1.1 and WP 3.3 with Headway 2.0.13.

    Based on the contents in a database I'd like to pre-populate - using gform_pre_render() - the state of a months worth of checkboxes (i.e. the checkbox is selected/checked if there is content saved for that column in the database table).

    The data gets saved correctly (so I believe my gform_after_submission() function does "the right thing").

    It's upon subsequently reading the data that the checkmark for the previously selected/checked checkbox will "jump" one additional space (day) out in time for every 10th day. Meaning, pre-save, if I checked the checkbox for day 25, it will be rendered as checked on the 27th day when I go back to the form after saving. If I'd checked day 10 pre save, it will now render as day 11, etc.

    When checking the database, the correct column - i.e. the column for day 25 - _is_ set in the table.

    I've got the code I use pasted here: http://pastebin.com/xmcmBWD7

    Also, I've got screen shots of the pre and post save form at the following locations:

    Before Save: http://www.wickedstrongbootcamps.com/wp-content/uploads/2012/01/Before-save.tiff
    After Save: http://www.wickedstrongbootcamps.com/wp-content/uploads/2012/01/After-save.tiff

    Posted 12 years ago on Wednesday January 25, 2012 | Permalink
  2. Additionally, the following HTML is a bit perplexing to me. Notice how the ID number skips 20? The same happens for 10 and 30 which seems to tie in to the fact that the checkbox moves and I infer from this that if I had 100 checkboxes created, I'd wind up with the 101st checkbox having the id of 2.111 (and not 2.101 which - since I don't know any better - is what I'd have expected it to be)

    <li class='gchoice_2_19'><input name='input_2.19' type='checkbox'  value='18'  id='choice_2_19' tabindex='19'  /><label for='choice_2_19'>Jan 18</label></li>
    <li class='gchoice_2_21'><input name='input_2.21' type='checkbox'  value='19'  id='choice_2_21' tabindex='20'  /><label for='choice_2_21'>Jan 19</label></li>
    <li class='gchoice_2_22'><input name='input_2.22' type='checkbox'  value='20'  id='choice_2_22' tabindex='21'  /><label for='choice_2_22'>Jan 20</label></li>
    Posted 12 years ago on Wednesday January 25, 2012 | Permalink