Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery TimePicker does not work
    primarykey
    data
    text
    <p>I have following issue with datetimepicker. It works in first form where I have only one field for date, but it doesn't in this second form.</p> <p>Java scripts:</p> <pre><code> &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/localization/messages_de.js"&gt;&lt;/script&gt; &lt;script src="http://trentrichardson.com/examples/timepicker/jquery-ui-timepicker-addon.js"&gt;&lt;/script&gt; </code></pre> <p>Form which does not work:</p> <pre><code>&lt;script&gt; // register_form geburtsdatum date $().ready(function(){ $.validator.addMethod("dateTime", function (value, element) { var stamp = value.split(" "); var validDate = !/Invalid|NaN/.test(new Date(stamp[0]).toString()); var validTime = /^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i.test(stamp[1]); return this.optional(element) || (validDate &amp;&amp; validTime); }, "Please enter a valid date and time."); $( "#termin1" ).datetimepicker({ changeMonth: true, changeYear: true, yearRange: "-0:+1", dateFormat: 'yy-mm-dd' }); $( "#termin2" ).datetimepicker({ changeMonth: true, changeYear: true, yearRange: "-0:+1", dateFormat: 'yy-mm-dd' }); $( "#termin3" ).datetimepicker({ changeMonth: true, changeYear: true, yearRange: "-0:+1", dateFormat: 'yy-mm-dd' }); }); $().ready(function(){ $("#send_termin").validate({ rules: { termin1: { required: true, dateTime: true }, termin2: { required: true, dateTime: true }, termin3: { required: true, dateTime: true }, }, errorElement: "span", errorPlacement: function(error, element) { error.insertAfter(element); } }); }); &lt;/script&gt; </code></pre> <p>I use following HTML Form:</p> <pre><code>&lt;form action="" id="send_termin" method="post"&gt; &lt;input type="hidden" name="action" value="view_message_add" /&gt; &lt;input type="hidden" name="sid" value="&lt;?=$sid?&gt;" /&gt; &lt;label for="termin1"&gt;Erste Termin:&lt;/label&gt; &lt;input type="text" name="termin1" id="termin1" class="required" value="" size="30" /&gt; &lt;span&gt;&lt;/span&gt; &lt;br /&gt; &lt;label for="termin2"&gt;Zweite Termin:&lt;/label&gt; &lt;input type="text" name="termin2" id="termin2" class="required" value="" size="30" /&gt; &lt;span&gt;&lt;/span&gt; &lt;br /&gt; &lt;label for="termin3"&gt;Dritte Termin:&lt;/label&gt; &lt;input type="text" name="termin3" id="termin3" class="required" value="" size="30" /&gt; &lt;span&gt;&lt;/span&gt; &lt;br /&gt; &lt;label for="message"&gt;Nachricht:&lt;/label&gt; &lt;textarea rows="4" cols="50" maxlength="1000" id="Nachricht" name="Nachricht"&gt;Schreib hier kurze Nachricht für ihren Gegner. (Max 1000 Zeichen) &lt;/textarea&gt; &lt;br /&gt; &lt;input type="submit" value="Senden" /&gt; &lt;/form&gt; </code></pre> <p>Any idea why it does not work?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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