html5-input-date

HTML5 input type date is sometimes empty value if entered incorrectly

大城市里の小女人 提交于 2021-02-09 08:20:56
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

HTML5 input type date is sometimes empty value if entered incorrectly

*爱你&永不变心* 提交于 2021-02-09 08:19:24
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

HTML5 input type date is sometimes empty value if entered incorrectly

天涯浪子 提交于 2021-02-09 08:17:59
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

HTML5 input type date is sometimes empty value if entered incorrectly

99封情书 提交于 2021-02-09 08:17:34
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

HTML5 input type date is sometimes empty value if entered incorrectly

Deadly 提交于 2021-02-09 08:17:26
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

HTML5 input type date is sometimes empty value if entered incorrectly

让人想犯罪 __ 提交于 2021-02-09 08:16:34
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

HTML5 input type date is sometimes empty value if entered incorrectly

折月煮酒 提交于 2021-02-09 08:13:39
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

HTML5 input type date is sometimes empty value if entered incorrectly

倖福魔咒の 提交于 2021-02-09 08:12:57
问题 There is a crazy thing with input type date. Here is my html: function getValue() { $('#entered').text($('input[name=test_date]').val()); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="date" min="2018-01-01" max="2018-05-05" name="test_date"> <button onclick="getValue()">Get value</button> <p>Entered: <span id="entered"></span></p> If I enter an invalid value, it will change to valid value automatically. But not always true. The max

How convert input type=“date” in timestamp javascript-jquery

半城伤御伤魂 提交于 2020-06-12 06:19:01
问题 I need to convert a in a timestamp, this is my html code: <input type="date" name="date_end" id="date_end"> This field has a value that I have put like 25/10/2017 My jquery code is: var dataEnd = $('[name="date_end"]').val(); if (!dataEnd) { return false; } else { var timestamp_end=$('[name="date_start"]').val().getTime(); console.log("TIMESTAMP END "+timestamp_end); ..... } But this is not work, anyone can help me? 回答1: make a new Date() passing the value of your input as parameter, then

How convert input type=“date” in timestamp javascript-jquery

随声附和 提交于 2020-06-12 06:17:51
问题 I need to convert a in a timestamp, this is my html code: <input type="date" name="date_end" id="date_end"> This field has a value that I have put like 25/10/2017 My jquery code is: var dataEnd = $('[name="date_end"]').val(); if (!dataEnd) { return false; } else { var timestamp_end=$('[name="date_start"]').val().getTime(); console.log("TIMESTAMP END "+timestamp_end); ..... } But this is not work, anyone can help me? 回答1: make a new Date() passing the value of your input as parameter, then