JavaScript Passing bootstrap modal value into php pass data bootstrap modal,pass parameter bootstrap modal,pass to

I have following model to collect data.

           <form class="form-login" name="myform" action="transactionsave.php" method="post">
                      <div class="modal fade" id="transaction" role="dialog" >                 
                        <div class="modal-dialog modal-sm">             
                          <!-- Modal content-->
                          <div class="modal-content">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                              <h4 class="modal-title">New Transaction</h4>
                            </div>
                            <div class="modal-body">
                                    Select Date
                                        <div class="form-group">                                                        
                                            <input type="text" id="datepicker1" name="datepicker1" class="form-control clsDatePicker" 
                                            placeholder="<?php echo date('Y-m-d')?>" type="text" value="<?php echo date('Y-m-d')?>" required>                 
                                        </div>                
                                   <div class="form-group">
                                   Income/ Expenses             
                                        <select class="form-control" size="1" name="maincat" onChange="setOptions(document.myform.maincat.options[document.myform.maincat.selectedIndex].value);">
                                        <optgroup label="Income">
                                            <option value="Income" selected="selected">Income</option>
                                        </optgroup>
                                        <optgroup label="Expenses">
                                            <option value="Bank charges">Bank charges</option>
                                            <option value="Bills">Bills</option>
                                            <option value="Clothing">Clothing</option>
                                            <option value="Donations">Donations</option>
                                            <option value="Education">Education</option>
                                            <option value="Electronic">Electronics</option>
                                            <option value="Food">Food</option>
                                            <option value="Health care">Health care</option>

                                        </optgroup>
                                      </select> 
                                        </br>

                                   </div>               
                                   Amount     
                                   <input type="text" class="form-control" placeholder="Amount" onKeyPress="return isNumberKey(event)" maxlength="12" required ></input>
                                        </br>   
                                  </div>
                                 <div class="modal-footer">
                                    <button data-dismiss="modal" class="btn btn-info" type="button">Cancel</button>
                                    <input type="submit" class="btn btn-success" value="Submit" />  
                                 </div>
                          </div>

                        </div>
                        </form>
                    </div>

and i need to pass relevent data into php file named transactionsave.php .when i press submit button it's directing to transactionsave.php and gives following error page.

Notice: Undefined index: type in C:\wamp\www\OFMS\dash_board\transactionsave.php on line..

Notice: Undefined index: SelectedDate in C:\wamp\www\OFMS\dash_board\transactionsave.php on..

and so on..

and my transactionsave.php code as follows..

                    <?php
                $type=$_POST['type'];
                $SelectedDate=$_POST['SelectedDate'];
                $amount=$_POST['amount'];
                $payee=$_POST['payee'];
                $maincat=$_POST['maincat'];
                $subcat=$_POST['subcat'];
                $comments=$_POST['comments'];

                session_start();
                $session=$_SESSION['user'];
                $con=mysqli_connect("localhost","root","123","wfms");
                // Check connection
                if (mysqli_connect_errno())
                  {
                  echo "Failed to connect to MySQL: " . mysqli_connect_error();
                  }
                            echo "$type"."</br>";
                            echo "$SelectedDate"."</br>";
                            echo "$amount"."</br>";
                            echo "$payee"."</br>";
                            echo "$maincat"."</br>";
                            echo "$subcat"."</br>";
                            echo "$comments"."</br>";
                mysqli_close($con);
                ?> 

since i'm new to this please let me know how to pass relevant data from modal to php..

Answer:1

I have such string: "{{foo}} is {{bar}}" I would like to extract values from {{}}, how I can achieve this? Expected result is ["foo", "bar"] I tried "{{foo}} is {{bar}}".match(/\{\{(.*?)\}\}/g) ...

I have such string: "{{foo}} is {{bar}}" I would like to extract values from {{}}, how I can achieve this? Expected result is ["foo", "bar"] I tried "{{foo}} is {{bar}}".match(/\{\{(.*?)\}\}/g) ...

  1. javascript simple string hash
  2. javascript simple string encryption
  3. javascript simple string replace
  4. javascript simple string search
  5. javascript simple string compression
  6. javascript simple encode string
  7. javascript simple random string
  8. javascript simple encrypt decrypt string
  9. javascript simple quote in string

I have an ordered list of items that I want to be displayed. Getting this done with Angular is trivial: <p>Filter a game: <input type="text" ng-model="search.name" /></p> <game-...

I have an ordered list of items that I want to be displayed. Getting this done with Angular is trivial: <p>Filter a game: <input type="text" ng-model="search.name" /></p> <game-...

There is a nested object: var a = { b: { c: 'some value' } } Is there a way to make a destructing assignment to get following two variables with only one statement? var c = 'some value'; ...

There is a nested object: var a = { b: { c: 'some value' } } Is there a way to make a destructing assignment to get following two variables with only one statement? var c = 'some value'; ...

  1. destructuring assignment to assign variables from objects
  2. destructuring assignment to assign variables from arrays
  3. destructuring assignment to assign variables from nested objects
  4. destructuring assignment to assign variables
  5. use destructuring assignment to assign variables from objects
  6. use destructuring assignment to assign variables from arrays
  7. use destructuring assignment to assign variables from nested objects
  8. use destructuring assignment to assign variables from objects freecodecamp
  9. use destructuring assignment to assign variables from objects solution
  10. use destructuring assignment to assign variables from arrays freecodecamp

I have a jQuery lightbox setup with a number of 300x300px images that on click open the lightbox. I would like to be able to overlay an semi-opaque background and text information with the video ...

I have a jQuery lightbox setup with a number of 300x300px images that on click open the lightbox. I would like to be able to overlay an semi-opaque background and text information with the video ...