Asp.NET javascript function postback problem

V

Viktor Popov

I have a javascript functions which are used for populating 2 select boxes.
The first select box is used for continent names, the second for the
countries in the contint. When I click on a continent, in the second select
box, are shown the countries. Everything works well accept one thing. When I
try to submit the selected items an error occured:
"Object doesn't support this property or method!" Line 124. On this line is
the postIt() function body or: this.click(). This error occures only when I
select continent and after that country. If I select continent only, the
submition works. How to avoid this problem?
I use this javascript function:

function postIt()
{
this.click();
}

because I have an asp:button which do this:
private void submit_Click(object sender, System.EventArgs e)
{
id.Text=result.Text; //continent
lbl.Text=resultat.Text;//country

}
In the Page_Load I have
private void Page_Load(object sender, System.EventArgs e)
{
submit.Attributes.Add("onclick", "postIt();");
}
 
S

Sharon

Hi Viktor.
This group is for c#.
Anyway, you don't need that javascript function.
What ever you need to do, you can do it in submit_Click,
and then redirect the page, if needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top