update gravity form update time input with mysqli

Question

Im trying to update gravity form entries with some success.
the problem i have is in the time input.

all the other entries are updating.
but the time fields in the sql are stile empty.

  1. the HTML input structure by GF is like this:
<li id="field_16_6" class="gfield gf_right_half gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible"><label class="gfield_label gfield_label_before_complex">Class Ends At<span class="gfield_required">*</span></label>
    <div class="clear-multi">
        <div class="gfield_time_hour ginput_container ginput_container_time" id="input_16_6">
            <input type="number" maxlength="2" name="input_6[]" id="input_16_6_1" value="" tabindex="8" min="0" max="12" step="1"> <i>:</i>
            <label for="input_16_6_1">HH</label>
        </div>
        <div class="gfield_time_minute ginput_container ginput_container_time">
            <input type="number" maxlength="2" name="input_6[]" id="input_16_6_2" value="" tabindex="9" min="0" max="59" step="1">
            <label for="input_16_6_2">MM</label>
        </div>
        <div class="gfield_time_ampm ginput_container ginput_container_time">

            <select name="input_6[]" id="input_16_6_3" tabindex="10" aria-label="AM/PM">
                <option value="am">AM</option>
                <option value="pm">PM</option>
            </select>
        </div>
    </div>
</li>

using GF function of rgpost(“input_5[]”) returned empty.
and building the time string myself not working as I expected.

i have build this:

  $end_time = $_POST["input_6"];
  $end_time_str = $end_time[0] . ':'. $end_time[1] . ' ' . "$end_time[2]";

but all i get is the wrong time stricture in the database. when the currect one is hh:mm am
how can i get the correct time values?

0
, , Doron Davidowitz 1 year 2019-10-22T07:24:51-05:00 0 Answers 85 views 0

Leave an answer