title: Send Form Value to Modal
body: <p>I have a form that asks for 3 fields. Once the form is submitted, it should open a modal. In the modal a budget summary should show. The budget summary data is pulled from a database and the values are based on the 3 form fields entered. I can't seem to get the values to show up in the modal so the query will work but, the modal does open.</p>
  <p>Here is the modal code:</p>
  <pre><code>    &lt;!-- Large modal --&gt;
  &lt;div class=&quot;modal fade bd-example-modal-lg&quot; tabindex=&quot;-1&quot; id=&quot;myLargeModalLabel&quot; role=&quot;dialog&quot; aria-labelledby=&quot;myLargeModalLabel&quot; aria-hidden=&quot;true&quot;&gt;
    &lt;div class=&quot;modal-dialog modal-lg&quot;&gt;
      &lt;div class=&quot;modal-content p-4&quot;&gt;
       &lt;h4 class=&quot;modal-title&quot;&gt;Budget Summary&lt;/h4&gt;For Account: &lt;?php echo $account; ?&gt;, Fund: &lt;?php echo $_POST['fund2']; ?&gt;, DeptID#: &lt;?php echo $deptID; ?&gt;&lt;br&gt;&lt;em&gt;The budgeted balance is an estimate.&lt;/em&gt;&lt;/h4&gt;
        &lt;br&gt;  &lt;?php if ($budget_summary-&gt;TotalRows == 0) { // Show if mysqli recordset empty ?&gt;There is no data. Please try your search again.&lt;?php } ?&gt;
          &lt;?php if ($budget_summary-&gt;TotalRows &gt; 0) { // Show if mysqli recordset empty ?&gt;&lt;table width=&quot;100%&quot; class=&quot;table table-responsive&quot; border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;6&quot; class=&quot;display&quot; id=&quot;example2&quot;&gt;
              &lt;thead&gt;
                &lt;tr&gt;
                  &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Budgeted Amount&lt;/th&gt;
                   &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Budgeted Balance&lt;/th&gt;
                   &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Program&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                &lt;?php
  while(!$budget_summary-&gt;atEnd()) {
  ?&gt;&lt;tr&gt;
  &lt;td valign=&quot;top&quot;&gt;$&lt;?php echo($budget_summary-&gt;getColumnVal(&quot;budgeted_amount&quot;)); ?&gt;&lt;/td&gt;
  &lt;td valign=&quot;top&quot;&gt;$&lt;?php echo($budget_summary-&gt;getColumnVal(&quot;budgeted_balance&quot;)); ?&gt;&lt;/td&gt;
  &lt;td valign=&quot;top&quot;&gt;&lt;?php echo($budget_summary-&gt;getColumnVal(&quot;program&quot;)); ?&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;?php
    $budget_summary-&gt;moveNext();
  }
  $budget_summary-&gt;moveFirst(); //return RS to first record
  ?&gt;
              &lt;/tbody&gt;
            &lt;/table&gt;&lt;?php } ?&gt;
            &lt;div class=&quot;modal-footer&quot;&gt;
          &lt;button type=&quot;button&quot; class=&quot;btn btn-default&quot; data-dismiss=&quot;modal&quot;&gt;Close&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Here is the sql query:</p>
  <pre><code>&lt;?php
  $budget_summary = new WA_MySQLi_RS(&quot;budget_summary&quot;,$sa,0);
  $budget_summary-&gt;setQuery(&quot;SELECT * from budget_summary where fund = ? and account = ? and deptID = ?&quot;);
  $budget_summary-&gt;bindParam(&quot;i&quot;, &quot;&quot;.$_POST['fund '] .&quot;&quot;, &quot;-1&quot;); //colname
  $budget_summary-&gt;bindParam(&quot;i&quot;, &quot;&quot;.$_POST['account']  .&quot;&quot;, &quot;-1&quot;); //colname2
  $budget_summary-&gt;bindParam(&quot;i&quot;, &quot;&quot;.$_POST['funding_department'] .&quot;&quot;, &quot;-1&quot;); //colname3
  $budget_summary-&gt;execute();
  ?&gt;
  </code></pre>
  <p>Here is the form:</p>
  <pre><code>&lt;form method=&quot;POST&quot; id=&quot;frm&quot; name=&quot;frm&quot;&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col mb-2&quot;&gt;
      &lt;label for=&quot;account&quot;&gt;Account:&lt;/label&gt;
     &lt;select class=&quot;form-control&quot; name=&quot;account2&quot; id=&quot;account2&quot; required&gt;
        &lt;option&gt;&lt;/option&gt;
       &lt;?php
  while(!$accounts-&gt;atEnd()) { //dyn select
  ?&gt;
                  &lt;option value=&quot;&lt;?php echo($accounts-&gt;getColumnVal(&quot;account&quot;)); ?&gt;&quot;&gt;&lt;?php echo($accounts-&gt;getColumnVal(&quot;account&quot;)); ?&gt;: &lt;?php echo($accounts-&gt;getColumnVal(&quot;description&quot;)); ?&gt;&lt;/option&gt;
                  &lt;?php
    $accounts-&gt;moveNext();
  } //dyn select
  $accounts-&gt;moveFirst();
  ?&gt;
        &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class=&quot;col mb-2&quot;&gt;
      &lt;label for=&quot;fund&quot;&gt;Fund:&lt;/label&gt;
       &lt;select class=&quot;form-control&quot; name=&quot;fund2&quot; id=&quot;fund2&quot; required&gt;
        &lt;option&gt;&lt;/option&gt;
       &lt;?php
  while(!$funds-&gt;atEnd()) { //dyn select
  ?&gt;
                  &lt;option value=&quot;&lt;?php echo($funds-&gt;getColumnVal(&quot;fundID&quot;)); ?&gt;&quot;&gt;&lt;?php echo($funds-&gt;getColumnVal(&quot;fundID&quot;)); ?&gt;: &lt;?php echo($funds-&gt;getColumnVal(&quot;fund&quot;)); ?&gt;&lt;/option&gt;
                  &lt;?php
    $funds-&gt;moveNext();
  } //dyn select
  $funds-&gt;moveFirst();
  ?&gt;
        &lt;/select&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col mb-2&quot;&gt; 
              &lt;label for=&quot;fund&quot;&gt;Department ID#:&lt;/label&gt;
               &lt;input type=&quot;text&quot; name=&quot;funding_department2&quot; id=&quot;funding_department2&quot; class=&quot;form-control input-md&quot; autocomplete=&quot;off&quot; value=&quot;&quot; required&gt;
      &lt;/div&gt;&lt;/div&gt;
  &lt;button type=&quot;submit&quot; name=&quot;submit2&quot; id=&quot;submit2&quot; class=&quot;btn-lg btn-info&quot;&gt;Search&lt;/button&gt;   
      &lt;/form&gt;
      &lt;script&gt;
      $(document).ready(function() {
    $('#frm').on('submit', function(e){
        $('#myLargeModalLabel').modal('show');
        e.preventDefault();
    });
  });
  &lt;/script&gt;
  
  </code></pre>
  <p>Any tips would be appreciated on how to make this happen. I have been trying for days to figure it out. Thank you.</p>