crystalb24
Programmer
This is the code that I am currently using to allow the user to add a value to a drop down menu.
What I would like to be able to do is to not only allow the user the ability to add there own value, but also trigger a certain choice in the drop down menu to prompt the user to upload a file or choose an existing file, but I'm not sure how to write the code to do this. Anyone help?
~Crystal
Click here ( for a free iPod
Code:
<script type="text/javascript">
function addNewValue(targ) {
if (targ.value == 'Add') {
newVal = prompt('Create your own Pre-meeting checklist item');
newOpt = document.createElement('option');
newOpt.setAttribute('value',newVal);
optText = document.createTextNode(newVal);
newOpt.appendChild(optText);
targ.insertBefore(newOpt,targ.lastChild);
}
}
</script>
<body>
<table>
<tr>
<td>
I.
</td>
<td>
<select name="Pre-meeting checklist">
<option></option>
<option value="choice">Schedule appointment</option>
<option value="insert">Send letter/agenda/questionnaire</option>
<option value="choice">Request send in / bring in documents</option>
<option value="choice">Set up electronic & hard copy files</option>
<option value="choice">Schedule team participants for <b>Understand Your Goals</b> meeting</option>
<option value="choice">Assemble materials needed for meeting</option>
<option value="choice">Facilities check</option>
<option value="Add">Add your own item</option>
</select>
</td>
</tr>
</table>
What I would like to be able to do is to not only allow the user the ability to add there own value, but also trigger a certain choice in the drop down menu to prompt the user to upload a file or choose an existing file, but I'm not sure how to write the code to do this. Anyone help?
~Crystal
Click here ( for a free iPod