Hi,
I just start to learn HTML javascript, facing some issue for the submit button.
Using HTML and scripts, create a form as shown in the figure below to allow user to enter their favorite food information.
[ATTACH]17549[/ATTACH]
when the user click the SUBMIT button, the following output needs to be displayed to the user.
[ATTACH]17551[/ATTACH]
[code=html]
<form>
<table>
<tr>
<td>Name:</td>
<td>
<input type=”text” name = “Fname” size=”30″
</td>
</tr><
<tr>
<td>Age:</td>
<td><input type = “text” name = “age” size = “30” maxlength=”2″
</td>
</tr>
<tr>
<td>Gender :
</td>
<td>
<select name = “type” size ‘1’>
<option value = ‘Male’> Male </option>
<option value = ‘Female’> Female </option>
</select>
</td>
</tr>
<tr>
<td>Favourite food :</td>
<td><input type = ‘radio’ name = ‘size’ value = ‘Burger’/>Burger
</td>
</tr>
<tr>
<td></td>
<td><input type = ‘radio’ name=”size” type=”radio” value=”Pizza”/>Pizza</td>
</tr>
<tr>
<td></td>
<td><input type = ‘radio’ name=”size” type=”radio” value=”Roti Canai” />Roti Canai</td>
</tr>
</form>
</body>
</table>
<p>Your comment about the food <br />
<textarea style=”margin: 0px; width: 286px; height: 119px;” cols=”number_of_characters” name=”element_Name” rows=”number_of_rows” wrap=”Type_of_wrap”></textarea></p>
<br><br>
<input type= “button” value=”SUBMIT” onclick=”writeName()”)>
<input type= “RESET” value=”RESET”>
<script type=”text/javascript”>
function writeName(){
var welcomeMsg = document.getElementById(‘welcome’);
var name = document.getElementById(‘name’).value;
var Age = document.getElementById(‘Age’).value;
welcomeMsg.innerHTML = “Welcome “+name.value+”.<br/>’;
//document.write (Name + ” is ” + Age + ” years old.”);
}
</script>
Please help.
Thanks