开发者

jQuery Selector & Events

开发者 https://www.devze.com 2023-01-18 03:56 出处:网络
Jquery UI Function: // Datepicker $(\'#datepicker\').datepicker({ inline: true }); Event:开发者_JAVA百科

Jquery UI Function:

// Datepicker
$('#datepicker').datepicker({
inline: true
});

Event:开发者_JAVA百科

<input name="txtLogistics_ExecutionDate" type="text" id="datepicker" onfocus="datepicker();" />

My question is:

have confusion on how to implement datepicker across multiple text fields.

Do I have to named each text field ID on the function? How can I assign to any field or pass the ID to Jquery?


You can use a class, for example:

$('.datepicker').datepicker({
  inline: true
});

With elements like this:

<input class="datepicker" name="txtLogistics_ExecutionDate" type="text" />
<input class="datepicker" name="txtLogistics_OtherDate" type="text" />
<input class="datepicker" name="txtLogistics_YetAnotherDate" type="text" />

This will apply the .datepicker() widget to each element with that class.

0

精彩评论

暂无评论...
验证码 换一张
取 消