I have a form with dropdown boxes that are populated from a MySQL database. I am trying to add an option next to the dropdown so that it will invoke a popup window so the user can quickly add a new name to the database lookup table. (The one that populates the drop down right next to it). The popup form consists of a text box and a submit button. Once the popup form has been submitted the value is being added database, and the parent window can be refreshed automatically to show the new value in the menu.
The only bad part about this whole scenario is that not only the menus are being refreshed but also the form fields that already have been filled out. Not a very desireable effect.
If the data being added to the child form and does not exist in teh database the function does not add the child window value to the option selected. (and that would be its only purpose). I have tested with an existing value (such as Smith, Jack in my example below) and it works fine. It also works fine while updating a plain text input field. It just wont let me add it to the selected option on a fresh add to the employees table without first refreshing the parent form.
/// Code on parent form
<select size="1" style="width: 80%" name="employee">
$query="SELECT * FROM employees";
$result = mysql_query ($query);
print "<option value='myEmp'>$nt[employee]</option>";
////// function on child form
opener.document.MySubmit.Employee.value = "Smith, Jack";