javascript - passing data through text box from select option into another page -


i trying pass data through text box selected through 'other' in select option. however, when run program, data not passed. ideas how resolve this? here code using. have added of code below. have pass information through select option in form of text box. information not passed. there other method can this, passing through text page?

 <?php include_once("header.php"); ?>  <?php  $q_sel = "select * tbl_drug"; $r_sel = mysql_query($q_sel); ?>   <head>         <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>         <script> $( document ).ready(function() {             $('#my_textarea').hide(); $('#quantity').change(function()     {         var o = $(this).find('option:selected').val();         console.log(o);         if(o=='other') $('#my_textarea').show(); else $('#my_textarea').hide(); });             });         </script>     </head> <body style="background-color: #25383c;background-image: url(img/background.png);">       <?php include_once("nav.php"); ?>          <h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;medication appropriateness index</h1>         <div class="container-fluid">         <div class="row">              <div class="col-sm-12">              <div class="well">              <form class="form-horizontal" role="form" action="save_drug.php" method="post">              <div class="form-group">                   <label class="control-label col-sm-2">drug:</label>                   <div class="col-xs-3">                   <select name="drug" id="drug" class="form-control" required="">                           <option value="" selected="" disabled="">please select drug...</option>                           <?php                           while($r1 = mysql_fetch_array($r_sel))                           { ?>                           <option value="<?php echo $r1['d_id']; ?>"><?php echo $r1['drug_name']; ?></option>                           <?php                           }                          ?>                    </select>                   </div>              </div>               <script> $(function() {     $("#dose").tooltip(); }); </script>          <div class="form-group">                   <label class="control-label col-sm-2">route:</label>                   <div class="col-xs-3">                   <select id="quantity" name="quantity" class="form-control" required="">                           <option value="" selected="" disabled="">please select dosage...</option>                           <option value="po">po</option>                           <option value="iv">iv</option>                           <option value="pr">pr</option>                           <option value="topically">topically</option>                           <option value="other">other (please specify)</option>                     </select>                       <textarea name="my_textarea" id="my_textarea"></textarea>                     </div>                  </div>                   <div class="form-group">                   <div class="col-sm-offset-2 col-sm-10">                   <input type="hidden" name="patient_id" value="<?php echo $_get['patient_id']; ?>">                   <button type="submit" class="btn btn-default">submit</button>                   </div>              </div>              </form>               </div>              </div>          </div>         </div>   </body> </html> 

always use 'name' attribute inputs , because name can send data on submit.

<textarea name="my_textarea" id="my_textarea"></textarea> 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -