I have a small page I'm trying to figure out. Basically, what the user does is select a race from a dropdown list and it will dynamically update the page display, adding or subtracting to the base stats. Here is the code:
<html>
<body>
<table bgcolor="#6699CC" align=center bordercolor="#000000" border=3>
<form action="new.php" method="POST">
<p>
<tr><td>
Character Name:
</td>
<td>
<input type="text" name="name" />
</td></tr>
<p>
<tr><td>
Password:
</td>
<td>
<input type="password" name="password" />
</td></tr>
<p>
<tr><td>
Enter Password Again:
</td>
<td><input type="password" name="confirm pass" />
</td></tr>
<p>
<tr><td>
Select Race -
<td>
<select name="race">
<option> Human
<option> Elf
<option> Half-Elf
<option> Dwarf
<option> Half-Orc
<option> Zirad
<option> Felis
<option> Illiad
<option> Dratic
</select>
</td></tr>
</table>
Yes, I know it's all in HTML format but I figured the part where it dynamically updated would be in PHP. The base stats displayed on the screen would show as follows:
STR: 350
DEX: 350
INT: 350
WIS: 350
CON: 350
These are also the default display for the Human. When the person selects a different race, I want this updated dynamically based upon each race, for example, if they choose Half-Elf:
STR: 300 (-50)
DEX: 400 (+50)
INT: 350
WIS: 350
CON: 300 (-50)
The numbers in parantheses don't neccesarily need to be displayed. This should be updated on the page without the use of a submit button, selecting should update automatically.