469,658 Members | 1,826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,658 developers. It's quick & easy.

Microsoft JScript runtime error: Object expected

function Showdiv()
var SelectStates = document.getElementById('Select1').value;
if(SelectStates ="3")
document.getElementById("div2").style.display = "block";

document.getElementById("div2").style.display = "none";
function GoToPage()
var SelectStates = document.getElementbyId('Select1').Value;
window.open('LotteryResultPage.aspx?country='+Sele ctStates+);
I have above js function and i am calling those function like below in the ascx control.

<select id="Select1" onchange="Showdiv()">

<asp:Button runat="server" ID="Button1" Text="Go" OnClientClick="GoToPage()" />

but when i run this it gives error 'Microsoft JScript runtime error: Object expected' , can anybone tell me why?
Jan 21 '08 #1
1 2788
7,872 Expert 4TB
if that code is cut and paste then the problem is this:

window.open('LotteryResultPage.aspx?country='+Sele ctStates+);

You have an extra + at the end of your string
Jan 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

39 posts views Thread by tydbowl | last post: by
1 post views Thread by JNariss | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.