Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh a drop-down after addition on sep. page

Status
Not open for further replies.

schase

Technical User
Sep 7, 2001
1,756
US
Hi all,

I have one main form that will have like salesperson
This is a drop down listing them all. I would have a "Add" link just above it so the person entering info can add a salesperson to use for the form.

I have the link targeting a blank browser - and it add's to the tblSalesPerson perfectly fine. But when I close the add salesperson window, the origional drop-down box is still populated with the old information.

Is there anyway to close the addition window and have it refresh just that one drop down? I dont want to refresh the entire page - cause I'll loose whatever they entered up to that point. "Insert witty remark here"

Stuart
 
use window communication to do it. Hopefully you're spawning the new window via javascript, because that makes things alot easier.

anyways, the javascript would look something like this:

var frm = opener.document.formname;
var i = frm.dropDownName.length;
frm.dropDownName.options = new Option("text","value");

Then, change the onSubmit of your form to add the info needed:

Something like

<form onsubmit=&quot;changeForm()&quot;>
...
</form>

<script>
function changeForm() {
//fill in above code here
}
</script>

of course, if you don't know what goes in here until after you update the DB, you could use the body onload event to call the relevant javascript function.

here's some info that might help:
leo

------------
Leo Mendoza
lmendoza@garbersoft.net
 
I dont get how that would work. unless the bottom <script></script> is put on the drop down. &quot;Insert witty remark here&quot;

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top