Eenheden maken met berekende grondstoffen
Dit is mijn tabel voor het aanmaken:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
echo "<table border=1><TR><TD><b>Eenheid</b></TD><TD><b>Huidig aantal</b></TD><TD><b>Maken</b></TD></TR>";
echo "<TR><TD>Slaven</TD><TD>";
echo $slaven2;
echo "</TD><TD><form method=post action=><TEXTAREA NAME=slaven COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Burgers</TD><TD>";
echo $burgers2;
echo "</TD><TD><TEXTAREA NAME=burgers COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Onderbazen</TD><TD>";
echo $onderbazen2;
echo "</TD><TD><TEXTAREA NAME=onderbazen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Bazen</TD><TD>";
echo $bazen2;
echo "</TD><TD><TEXTAREA NAME=bazen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Heren</TD><TD>";
echo $heren2;
echo "</TD><TD><TEXTAREA NAME=heren COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Opperheren</TD><TD>";
echo $opperheren2;
echo "</TD><TD><TEXTAREA NAME=opperheren COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Koningen</TD><TD>";
echo $koningen2;
echo "</TD><TD><TEXTAREA NAME=koningen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Opperkoningen</TD><TD>";
echo $opperkoningen2;
echo "</TD><TD><TEXTAREA NAME=opperkoningen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD></TD><TD></TD><TD><input type=submit name=submit value=Maken!></TD></TR>";
echo "</form></table>";
echo "<TR><TD>Slaven</TD><TD>";
echo $slaven2;
echo "</TD><TD><form method=post action=><TEXTAREA NAME=slaven COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Burgers</TD><TD>";
echo $burgers2;
echo "</TD><TD><TEXTAREA NAME=burgers COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Onderbazen</TD><TD>";
echo $onderbazen2;
echo "</TD><TD><TEXTAREA NAME=onderbazen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Bazen</TD><TD>";
echo $bazen2;
echo "</TD><TD><TEXTAREA NAME=bazen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Heren</TD><TD>";
echo $heren2;
echo "</TD><TD><TEXTAREA NAME=heren COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Opperheren</TD><TD>";
echo $opperheren2;
echo "</TD><TD><TEXTAREA NAME=opperheren COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Koningen</TD><TD>";
echo $koningen2;
echo "</TD><TD><TEXTAREA NAME=koningen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD>Opperkoningen</TD><TD>";
echo $opperkoningen2;
echo "</TD><TD><TEXTAREA NAME=opperkoningen COLS=5 ROWS=1>0</TEXTAREA></TD></TR>";
echo "<TR><TD></TD><TD></TD><TD><input type=submit name=submit value=Maken!></TD></TR>";
echo "</form></table>";
Dat ziet er zo uit:
Nu wil ik dat, als een gebruiker dus '10' bijvoorbeeld invult automatisch wordt berekent hoeveel Steen, Ijzer, Staal en Geld dit kost.
Alvast Bedankt.
Je html kan gewoon met kleine letters. Ik mis overal de "quotes" in de html. En waarom een textarea voor het invoeren van een getal?
2) Er moeten 4 kolommen naast komen waar instaat hoeveel het kost. Enig idee?