Hi,
I need to get a variable value from dropdown and pass this to another JS file:

On <SELECT> i have Onchange event, which get dropdown value.
If I make selection, alert popup appear with correct value

file.php

... script ...
function __doPostBack(elm) {
var user_id = elm.options[elm.selectedIndex].value;
alert(user_id);
}
... script ...

My trouble is, how to get user_id value on another JS page?

I'm triyng to get dropdown_value variable on commonn.js but is blank

var dropdown_value = user_id;

Can anyone help me?

Thanks

Cris

You need to put a function in common.js, and call that function whenever the onchange event is fired.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.