I just happen to be doing exactly what you want at this minute
Javascript function for head of document (parent window):
var newWindow
function openNewWin(pageURL, pageName, width, height, top, left)
{
newWindow = window.open(pageURL, pageName,"width=" + width + ",height=" + height + ",top=" + top + ",left=" + left + ",scrollbars=1, resizable=1,toolbar=0,location=0,status=1,menubar= 0");
newWindow.focus()
}
Open new window link place in body (parent window):
<a href="#" onClick="openNewWin('pageName.asp','windowName',75 0,300,100,100);">Open Window</a>
put this code in your new window where you save the new category (child window):
if [your condition to detect inserting category] then
sql = "INSERT INTO..."
conn.execute(sql)
%>
<script language = JavaScript>
opener.history.go(0);
self.close();
</script>
<% end if %>
FYI: The above
JS code closes the active window once the categroy is inserted and refreshes the parent window so your new category appears in your list. BTW: Yes you can place some
JS in the middle of an ASP if condition
Wind is your friend
Matt