Questions Value dynamically insert into input box on selected

1454 asked on

Plz Help Me how i get value in input box when i select item code ? and value insert in item name & Price Per pc

<th>Item Code</th>
<th>Item Name</th>
<th>Price Per Pices</th>

<select name="itemcode" class="field-long" Id="myDropdown">
   <option selected="selected" value="-1">Select Item Code</option>
  <?php $k=1; $sql="select * from `product` order by id asc";
  <option value="<?php echo $eletronic['itemcode']?>"><?php echo $eletronic['itemcode']?></option>


<td><input type="text"  name="Item Name" id="Item Name" autocomplete="off"></td>
<td><input readonly type="text" name="quantity"  id="quantity" autocomplete="off"></td>
<td><input readonly type="text" name="price-per-pc"  id="price-per-pc" autocomplete="off"></td>
<td><input type="text" name="value"  id="value"></td>

table detail

CREATE TABLE IF NOT EXISTS product ( id int(11) NOT NULL auto_increment, itemcode varchar(50) NOT NULL, Item Name varchar(50) NOT NULL, PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

  • 1Use Ajax to fetch data and insert them into input fields.
Add Answer
All HTML codes will be stripped in the comment, except inline <code> HTML tag.

Can You Answer this? Help us answer the question!

    • Answer
    Supports basic Markdown syntax. Excluded syntaxes (Headers, Lists, Blockquotes, Table, Images)