invoice form

I am trying to create a form in which i can add/delete row dynamicly and there will two text box in each row.
item and price,when i select item it price populate automaticaly.

i have createed code but it do not work properly

Thx in advance my email id is [email protected]

can you post your code here for us to look at please?
:wink:

conn.php

<?php mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("dd") or die(mysql_error()); ?>

information.php

<?php $q=$_GET["q[]"]; // Example 1 /* $p = explode("/", $q); */ //echo $p[0]; // piece1 //echo $p[1]; // piece2 // Example 1 include"conn.php"; $sql="SELECT * FROM subcategory WHERE cat_id='$q[]' "; $result = mysql_query($sql); echo ""; ECHO""; while($row = mysql_fetch_array($result)) { echo ""; echo ""; } echo ""; echo "
"; ?>

invoice.php

1page
</HEAD>
<BODY>
<?php include"newinvoice.js"; ?>
<table align="center" border="0" width="90%" height="100%">
	

    <INPUT type="button" value="Delete Item" onClick="deleteRow('dataTable')" />
	 <INPUT type="button" value="Add Item" onClick="addRow('dataTable')" />
 <form method='post' action='pissueentry.php'>

 <table width="350px" cellspacing="0" cellpadding="0" border="0" ><tr><td align="left" width="100px">Item</td><td align="left" width="100px">Subcatogery</td><td align="left" width="100px">Price</td></tr>
 <tr><td colspan="4">
<TABLE id="dataTable" width="350px" border="0" cellspacing="0" cellpadding="0">

        <tr><td>
<?php include"conn.php"; $sql="SELECT * FROM category "; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo"$row[category]"; } ?>
	</td></tr>
<tr><td colspan=2 align='center'><input type='submit' value='Submit' name="receiveI"/></td></tr>
</table>
</td></tr></table>
</BODY>

newinvoice.js

i have above 4 pages and two table in my databse

Database: dd

table category

CREATE TABLE IF NOT EXISTS category (
cat_id int(2) NOT NULL AUTO_INCREMENT,
category varchar(25) NOT NULL DEFAULT ‘’,
PRIMARY KEY (cat_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

table category

INSERT INTO category (cat_id, category) VALUES
(1, ‘Fruits’),
(2, ‘Colors’),
(3, ‘Games’),
(4, ‘Vehicles’);

table subcategory

CREATE TABLE IF NOT EXISTS subcategory (
cat_id int(2) NOT NULL DEFAULT ‘0’,
subcategory varchar(25) NOT NULL DEFAULT ‘’,
price int(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

table subcategory

INSERT INTO subcategory (cat_id, subcategory, price) VALUES
(1, ‘Apple’, 0),
(2, ‘Red’, 20),
(3, ‘Cricket’, 30),
(4, ‘Cars’, 40);

Sponsor our Newsletter | Privacy Policy | Terms of Service