Ventura1
11-28-2005, 09:54 AM
Hello,
I was wondering if anyone can help, I have a script that is attached to the onclick event of button on my web form. The web form is an edit page which is in the form of a popup window, I use this script so that when the popup is closed the parent form refreshes and the data is reloaded.
The problem I have is that I call this popup from two seperate locations in my system and only one of them has the element "ScheduleControl_txtRefresh", obviously I could add this to the other form and let the script force a postback however this isn't what I want to achieve, I want to simply close the form without refreshing the parent when no element is found.
Here is my current script...
<script language="JavaScript" type="text/javascript">
function CloseRefreshParent()
{
var x=window.opener.document.getElementByID("ScheduleControl_txtRefresh");
x.value = "True";
window.opener.document.forms[0].submit();
window.close();
}
</script>
Thanks very much!
I was wondering if anyone can help, I have a script that is attached to the onclick event of button on my web form. The web form is an edit page which is in the form of a popup window, I use this script so that when the popup is closed the parent form refreshes and the data is reloaded.
The problem I have is that I call this popup from two seperate locations in my system and only one of them has the element "ScheduleControl_txtRefresh", obviously I could add this to the other form and let the script force a postback however this isn't what I want to achieve, I want to simply close the form without refreshing the parent when no element is found.
Here is my current script...
<script language="JavaScript" type="text/javascript">
function CloseRefreshParent()
{
var x=window.opener.document.getElementByID("ScheduleControl_txtRefresh");
x.value = "True";
window.opener.document.forms[0].submit();
window.close();
}
</script>
Thanks very much!