Click to See Complete Forum and Search --> : Problem to submit!!!


inventive
05-20-2005, 11:09 PM
<? $stok=$_POST['stok'];
?>

<html>
<head>
<title>Terminal Computer Services :: STOK</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script type="text/javascript">
function CalcPercnt(f) {
var val=f.peratuskeuntungan.value
//val: Percentage Field value
//f: form which percent1 is in
if (!val == ""){
var daTotal=(f.hargaseunit.value * (val / 100 + 1)).toFixed(2)
f.hargajualan.value = daTotal
f.profit.value=(daTotal-f.hargaseunit.value).toFixed(2)
}
}
</script>
<style type="text/css">
.ro{
background-color: royalblue;
color: white;
border: 2px solid skyblue;
}
</style>

<body>
<td width="77%" valign="top"><table width="975" height="33" cellpadding="0">
<tr>
<td width="969" height="30">

<a href="paparstok.php"><strong><font face="Verdana, Arial, Helvetica, sans-serif"><font color ="black"></font></font>
<h1><p align="center">STOK</h1></strong></a></p>

</p>
</td>
</tr>
</table><br><br><br><br>

<td width="99%" valign="top"><form action="insertstok.php" name="Imp" method="post">
<table width="50%" height="292" border="0" align="center" bgcolor="#000000">

<tr>
<td width="41%"><font color="#FFFFFF"><h3>Nama Produk:</h3></font></td>
<td width="29%"> <input name="namaproduk" type="text" size="25"></td>
</tr>

<tr>
<td width="29%"><font color="#FFFFFF"><h3>Harga Seunit:</h3><td width="71%"><input name="hargaseunit" type="text" size="25"></td>
</tr>
<tr>

<td width="29%"><font color="#FFFFFF"><h3>Peratus Keuntungan:</h3></td><td><select name="peratuskeuntungan" id="peratus">
<option>5</option>
<option>10</option>
<option>15</option>
<option>20</option>
<option>25</option>
<option>30</option>
</select></td>
</tr>
<tr>
<td width="41%"><font color="#FFFFFF"><h3>Harga Jualan:</h3><td width="30%"><input name="hargajualan" type="text" readonly class="ro" size="25"></td>
</tr>

<td width="41%"><font color="#FFFFFF"><h3>Profit:</h3><td width="30%"><input name="profit" type="text" readonly class="ro" size="25"></td>
</tr>
<br><br><br>
<tr><td height="95">&nbsp;</td>
<td><input onClick="CalcPercnt(this.form)" type="button" value="Calculate">
<input type="reset" value="Clear"></td>
</tr></form>

<tr><td width="29%"><font color="#FFFFFF">
<h3>Bil Stok:</h3></font></td>
<td width="71%"><input name="bilstok" type="text" size="25"></td>
</tr>

<td><font color="#FFFFFF"><h3>Tarikh<em>(dd/mm/yy)</em>:</h3></font></td><td>
<input name="tarikh" type="text" size="25"></td>
</tr>

<tr><td height="95">&nbsp;</td>
<td><input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
<br><br>
<a href="produk.php"><strong><font face="Verdana, Arial, Helvetica, sans-serif"><font color ="black"></font></font>
<h2><p align="center">PRODUK</h2></strong></a></p>
</td>
</tr>
</table>
</body>
</html>


I have problem to submit.When submit,it doesnt go to the link that i want.Please someone help me!

BeachSide
05-21-2005, 01:32 AM
is this where you want it to go? insertstok.php because that is where you have it going to

::Edit::

You need to show the form where to submit. Find this line...
<form action="insertstok.php" name="Imp" method="post">

and where it says insertstok.php put the path you want the form to submit to for example...
<form action="YOURSCRIPT.php" name="Imp" method="post">

you will also need to name the form appropratly at the name="Imp" for example name="form1"

Ultimater
05-22-2005, 01:07 AM
You ended your FORM tag too early:

<input type="reset" value="Clear"></td>
</tr></form>

<tr><td width="29%"><font color="#FFFFFF">
<h3>Bil Stok:</h3></font></td>
<td width="71%"><input name="bilstok" type="text" size="25"></td>
</tr>

<td><font color="#FFFFFF"><h3>Tarikh<em>(dd/mm/yy)</em>:</h3></font></td><td>
<input name="tarikh" type="text" size="25"></td>
</tr>

<tr><td height="95">&nbsp;</td>
<td><input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset"></td>



Also, you should fix your JavaScript, find the code that reads:
if (!val == "")

and then change that to:
if (val != "")