Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery datepicker - dynamic selector
    primarykey
    data
    text
    <p>I am trying to call all the input fields with id of the pattern aaa*.bbb where * is a number between 1 to 100.</p> <p>My code is:</p> <pre><code> $(document).ready(function(){ $(PATTERN).datepicker({ showOn: 'both' }); }); </code></pre> <p>My problems are:</p> <ol> <li><p>If the id one of the input fields is simply "aaa.bbb" and I use <code>PATTERN = "#aaa\\.bbb"</code> then I can open the calendar, but no date is written into the input field when I click on a date... However if I omit the dot from the id and use <code>PATTERN = "#aaabbb"</code> I can select a date by the calendar. Hence I conclude that a dot in the id will not let me select a date by the calendar. How could it be??</p></li> <li><p>Suppose I solve the dot issue from (1), I actually want to call only the relevant INPUT fields. (suppose again the id one of the input fields is simply "aaa.bbb") so I tried something like <code>PATTERN = "input[id$='\\.bbb']"</code> but it did not work (the calendar button would not appear at all. Even though it is explained here: <a href="http://api.jquery.com/category/selectors/" rel="nofollow">http://api.jquery.com/category/selectors/</a> that in order to escape the dot character I "must escape the character with two backslashes: <code>\\.</code>" However when I try <code>PATTERN = "input[id$='\.bbb']"</code> the calendar button does appear, but again clicking on a date in the calendar would not cause the date to be written in the input field. Where do they say in the documentation that I have to use only one \ to escape the dot?</p></li> <li><p>Suppose I solve the dot issues from (1) and (2), how do I write that the pattern is of the form aaa*.bbb ???</p></li> </ol> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload