Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic form element not being recognized in $_post
    primarykey
    data
    text
    <p>I have a function that dynamically generates a form. Everything worked perfectly until I needed to add in an additional field to grab the unix timestamp that is to be passed in.</p> <p>The new hiddden field is identical to the previous one, except for the name of course, but <code>task_date</code> is NEVER included in the posted values.</p> <p>Here is the function</p> <pre><code> private function addTaskForm($court_id, $judge_id, $employee_id, $date) { // display add task form // if judge_id == null then display judge selection box // if employee_id == null then display employee selection box $form = "&lt;form method='post' action='#'&gt;"; $form .= "&lt;input type='hidden' name='court_id' value='$court_id'&gt;"; $form .= "&lt;input type='hidden' name='task_date' value='$date'&gt;"; &lt;= this is the NEW element if($judge_id == null) $form .= Utils::selectJudge($this-&gt;db)."&lt;br /&gt;"; else $form .="&lt;input type='hidden' name='judge_id' value='$judge_id'&gt;"; if($employee_id == null) $form .= Utils::selectEmployee($this-&gt;db)."&lt;br /&gt;"; else $form .="&lt;input type='hidden' name='employee_id' value='$employee_id'&gt;"; $form .=Utils::selectTask($this-&gt;db)."&lt;br /&gt;&lt;br /&gt; &lt;select name='start_time'&gt;&lt;option&gt;Start&lt;/option&gt;".Utils::selectTime()." &lt;/select&gt; - &lt;select name='end_time'&gt;&lt;option&gt;End&lt;/option&gt;".Utils::selectTime()." &lt;/select&gt; &lt;input type='submit' name='btnAddTask' value='Add Task'&gt; &lt;/form&gt;"; return $form; </code></pre> <p>}</p> <p>Here is the output after cycling through the posted values:</p> <pre><code>key: court_id: 3 key: judge_id: 1 key: employee_id: 217 key: task_id: 1 key: start_time: 0800 key: end_time: Uknown key: btnAddTask: Add Task </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload