Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apply different CSS to different jQuery datepickers

I have several datepickers tied to input fields. They are created in the usual way:

$('#input1').datepicker(options1);
$('#input2').datepicker(options2);

Now I want to style them differently for each field. But when inspecting the page in Firefox, I see that each datepicker is a div with the same id: ui-datepicker-div! And they aren't descendants or siblings of input fields, so I don't see a way to use the inputs' ids in CSS selectors.

like image 863
Alexey Romanov Avatar asked Jul 02 '26 12:07

Alexey Romanov


1 Answers

I think that you'll have to use beforeShow or some other callback or event to modify the datepicker dynamically. You don't posted more details about options1 and options2 which you use. Probably you will have to solve more additional problems.

like image 52
Oleg Avatar answered Jul 05 '26 05:07

Oleg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!