Master/content pages: prob with passing a control to JS

J

Jokke

Hi,

my code:

....
<script type="text/javascript">
var myfilter = myJSfunction(document.myform.ListBox1);
</script>
</form>

When compiling the web page, because of the master/content, the Listbox1
control gets a different name/id apparantly.

So how can I pass my listbox on as an argument of my JS procedure?


thx for helping,
J
 
M

Mark Rae [MVP]

When compiling the web page, because of the master/content, the Listbox1
control gets a different name/id apparantly.

That's correct. It's called ID munging and is totally standard behaviour.

So how can I pass my listbox on as an argument of my JS procedure?

var myfilter =
myJSfunction(document.getElementById('<%=ListBox1.ClientID%>'));
 
J

Jokke

Works like a dream and thx very much!

Mark Rae said:
That's correct. It's called ID munging and is totally standard behaviour.



var myfilter =
myJSfunction(document.getElementById('<%=ListBox1.ClientID%>'));
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top