how to get the datetime from control in ajax jquery RRS feed

  • Question

  • User-1722422105 posted

    Hi all

    how to  get the value of datetime from ajax call

    dateofbirth: $('#dobs').val()

    it is giving 0001 like 

    thanks and reagrds


    Tuesday, July 3, 2018 3:45 AM

All replies

  • User-369506445 posted


    you can get the value by $("#dobs").val();


    <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
        $(function() {
            $("#btn").click(function() {
                var date = $("#dobs").val();
    <input type="date" id="dobs" />
    <input type="button" id="btn" value="Get input Date value" />

    First<g class="gr_ gr_41 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" id="41" data-gr-id="41">,select</g> a date and <g class="gr_ gr_40 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" id="40" data-gr-id="40">nex</g> click on the <g class="gr_ gr_42 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" id="42" data-gr-id="42"><g class="gr_ gr_74 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" id="74" data-gr-id="74">button ,</g></g> then shows you the date with alert

    now, you can use the above code in your ajax call

    Tuesday, July 3, 2018 4:35 AM
  • User283571144 posted

    Hi sidu,

    According to your description, I couldn’t understand why you get the 0001 from a date control.

    Could you please post more details codes about the date and control and the ajax scripts?

    If you could post more details information and codes, it will be more easily for us to reproduce your issue and find a solution.

    Best Regards,


    Wednesday, July 4, 2018 6:44 AM
  • User-1171043462 posted

    Share your complete code, your AJAX call, how you are entering date, etc.

    Wednesday, July 4, 2018 6:18 PM