> Hi: Can any one please tell me how to i add a listbox and an Add
> button. So that when user click the add button the value will be
> goes into the listbox
Please reorder your original HTML tags.
You can add remove button if you wish, or validate input fields using
dom-standard.
For DOM HTML documentation :
http://www.w3.org/TR/DOM-Level-2-HTML/
Code below tested well on IE6 and FF1.5
HTH.
<html>
<head>
<script type="text/javascript">
function addSSN(elm)
{
var frm=elm.form;
var inp=frm.elements['ssn'];
var sel=frm.elements['ssn_list[]'];
var newElm = document.createElement('option');
newElm.setAttribute('value', inp.value);
newElm.setAttribute('text', inp.value);
newElm.innerHTML = inp.value;
sel.appendChild(newElm);
}
</script>
</head>
<body>
<form name='deceasedsocial' method='POST'>
<table border='0' align='center'>
<tr>
<td>Enter Social Security Number</td>
<td><input type='text' name='ssn'>
<input type="button" value="Add" onclick="addSSN(this);"></td>
</tr>
<tr>
<td colspan="2">
<select name="ssn_list[]" size="4" multiple style="width:200px;">
</select>
</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
.