Hi,
I have a page in which if i click a link will pops up a window(which has 2 dropdowns,checkbox and a button).
And when the user selects an option in the dropdown, checks the checkbox and hits the button a new page needs to be populatde in the first page.
For this i used
<a href=”javascript:void(0);” onclick=”Image_Click()”><asp:button text=”common” onclick=”btnClick” runat=”server”/></a>
i wrote the function image_click using java script as below:
<script type=”text/javascript” language=”javascript”>
function Image_Click()
{
var e=document.getElementbyId(“option”);
var opt=e.options[e.selectedIndex].value;
if (opt=’book’)
{
window.close();
window.opener.document.location.href=”www.bookstore.com”;
}
else if(opt=’pen’)
{
window.close();
window.opener.document.location.href=”www.penstore.com”;
}
else if(opt=’pn’)
{
window.close();
window.opener.document.location.href=”www.pnstore.com”;
}
else if(opt=’paper’)
{
window.close();
window.opener.document.location.href=”www.paperstore.com”;
}
else
alert();
}
</script>
When i open the link in the first or main page.the second page with dropdowns and checkboxes opens and when i select an option and than check the checkbox and proceed .only the first url([url]www.bookstore.com
I tried both single and double quotes everywhere and also used window.opener.document.location and window.opener.location.href and nothing works.
When i tried to run(debug) the aspx page it gives window.opener.document is null or not an object.
Can Anyone please Help me in this.
Thanks a Lot in Advance.