Dropdown list and client side javascript

  • Thread starter La Rocca Network S.A. / Nelson
  • Start date
L

La Rocca Network S.A. / Nelson

Hi folks !

I need to change the page located in a frame, base on user selection in a
DDL.
something like:

<script language="javascript">
function doSelect()
{
alert('You choose: ' + <here goes the text of the new selected item>);
window.top.frames["appframe"].location = <here goes a value held in the
database to which the DDL is bounded>;
}
</script>

the matter is ?
what can interact javascript with this control in the client side, so the
proper transfer of the page could be performed ?

thanks a lot
nelson
 
S

SB

Dear Nelson,

You need to hook to the dropdownlist the javascript event.
To do so, you can add in the page_load (when it's not a postback) the
following code

this.ddl.Attributes.Add("OnSelectedIndexChanged","doSelect();");

Selim
 
L

La Rocca Network S.A. / Nelson

Thank you so much

as it was in vb for asp.net I just changed

this.ddl.Attributes.Add("OnSelectedIndexChanged","doSelect();");

by

DDL.Attributes.Add("OnChange", "javascript:doSelect();")

I really appreciate your contribution.
And thanks devdex.com for the tracking.

regards,
nelson
 

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

Members online

Forum statistics

Threads
474,266
Messages
2,571,075
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top