Vinipuh Vinipuh - 1 year ago 75
jQuery Question

ASP.NET(with master page) How to get two ID in one time in jQuery

I have little problem, maybe somebody knows solution??? Usually to get two ID using jQuery I do like this:

$('#firstID, #secondID').datepicker({ ...

How i can do that using jQuery in ASP.NET (with MasterPage)??? I tried this:

$('[id$=firstID], [id$=secondID]').datepicker({ ...

It work, but not very well((( Thanks advance!!!

Answer Source

ok, I have no clue what you are talking about as far as 3 or 4 datepicker's opening at the sae time, but to answer your question, the easiest best way is to do this

$('.firstClass, .secondClass').datepicker({ ...

obviously classes would need to be assigned to the textboxes in the master page. Classes can be accessed from the child page where the ids get mangled and (can not as easily)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download