Hi have a quick question. Currently I am filling a form with data from a sql query. So for instance they select item number two and the form is filled with the data for item 2 from the data base. I then wish to be able be able to press my update button and have the data that is in the form submitted so that if it is changed in the form it changes in the data base. for example:
- item 1 is selected from the drop down list
- enter is pressed
- the page is refreshed and the form is populated with the data from the sql statement in the first submit
- ^^^ this works
I know have the info in the form and want to be able to hit the ubdate button so the old data is passed or type in in values and sub it. The problem is the variables and data that are stored in the form are not passed
Here is the page source
enter code here
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="css/main.css" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<title>Inventory</title>
</head>
<body>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="css/headercss.css" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<title>Inventory</title>
</head>
<body>
<div id="navigation">
<ul>
<li>
<a href="">Total Inventory</a>
<ul>
<li><a href="TotalInventory.php">Total Inventory</a></li>
<li><a href="NewItem.php">Add new Item</a></li>
<li><a href="SpecificItem.php">View Specific Item</a></li>
<li><a href="UpdateItem.php">Update Item</a></li>
</ul>
</li>
<li>
<a href="">House Inventory</a>
<ul>
<li><a href="#">House Inventory</a></li>
<li><a href="#">Add new Item</a></li>
</ul>
</li>
</ul>
</div>
</body> <br />
<form id="addItem" action="/workspace/iventory2/UpdateItem.php" method="post" >
<select name="items" id="items">
<option value"sdgssr5y">sdgssr5y</option><option value"a">a</option><option value"sf">sf</option><option value"gsh">gsh</option><option value"cat">cat</option><option value""></option><option value"afdsf">afdsf</option><option value"15">15</option><option value"zzz">zzz</option><option value"nnn">nnn</option><option value"dsdsgfsg">dsdsgfsg</option> </select>
<input class="submit" type="submit" value="Enter" name="submit"/>
<input class="update" type="submit" value="update" name="update"/>
</form>
<form method="post">
<br />
<form id="addItem" action="/workspace/iventory2/UpdateItem.php" method="post" autocomplete="off" >
<label>Item Name: <input name="ItemName" id="ItemName" value="15"/></label><label>CostPrice: <input name="CostPrice"id="CostPrice"value="10"/></label><label>CurrentLevel:<input name="CurrentLevel"id="CurrentLevel"value="10"/></label>
<input class="submit" type="submit" value="Enter" name="submit"/>
</form>
<form method="post">
</body>