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

  • Thread starter Thread starter Jokke
  • Start date Start date
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
 
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%>'));
 
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%>'));
 
Back
Top