jQWidgets Forums

jQuery UI Widgets Forums General Discussions jqxDateTimeInput value not available after Form Submit.

This topic contains 5 replies, has 3 voices, and was last updated by  admin 5 years, 7 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • Mahesh
    Participant

    Hi Peter,

    I want to get the date value from jqxDateTimeInput and I am not getting it in the Form keys collection after the form submit (post).

    My code lines are as below:

    <form id=”myForm” name=”myForm” style=”font-size:smaller” method=”post” action=”SaveCandidate” enctype=”multipart/form-data”>
    <input id=”BirthDate” name=”BirthDate” type=”date” />
    <input id=”JoiningDate” name=”JoiningDate” type=”datetime” />
    <input id=”btnSave” type=”submit” value=”Save” style=”width: 80px; “>
    </form>

    <script type=”text/javascript”>
    $(“#BirthDate”).jqxDateTimeInput({ width: ‘300px’, height: ’25px’ });
    $(“#JoiningDate”).jqxDateTimeInput({ width: ‘300px’, height: ’25px’ });
    </script>

    In fact the keys named “BirthDate” and “JoiningDate” are there in the form key collection but the value is missing.
    (for e.g. myHttpContext.Request.Form(“JoiningDate”) value is “”)

    It will be more helpful if you provide a fully working sample as I have already gone through your old posts in this regards.

    Regards,
    Mahesh


    Peter Stoev
    Keymaster

    Hi Mahesh,

    Working sample with jqxDateTimeInput and FORM submit: https://www.jqwidgets.com/jquery-widgets-demo/demos/php/registration_form.htm?material

    Best Regards,
    Peter Stoev

    jQWidgets team
    https://www.jqwidgets.com


    Mahesh
    Participant

    Hi Peter,
    Thanks for the reply.

    The Working sample (with jqxDateTimeInput and FORM submit) provided by you is using <div> tag
    see the line from your sample:
    <tr>
    <td>Birth date:</td>
    <td><div name=”birthdate” id=”birthInput”></div></td>
    </tr>

    If I too use <div> tag for date it works fine and I get the value in form collection.

    But I want to use input tag like this:
    <input id=”JoiningDate” name=”JoiningDate” type=”datetime” />

    When I do this the form collection shows the field JoiningDate but no value
    (i.e. myHttpContext.Request.Form(“JoiningDate”) value is “”)

    Can’t we use a input tag for type=(datetime, date and time) and submit the form with proper values.
    In my case it’s not working.


    admin
    Keymaster

    Hi Mahesh,

    The DateTimeInput is always a DIV tag even if you create it from INPUT tag. For faster initialization, we advice you to create it from DIV tag.

    Best Regards,
    Peter Stoev

    jQWidgets team
    https://www.jqwidgets.com


    Mahesh
    Participant

    Hi Peter,

    I already knew, it works with <DIV> tag.

    Sorry to ask you this, but if INPUT tag is not working in such a way then why it’s mentioned in the
    demos like we can Initialize from Input tags having type attributes:
    <input type=”date” id=’date’ />
    <input type=”time” id=’time’ />
    <input type=”datetime” id=’datetime’ />

    It would be so kind of you if you either justify me how it works after Initialized from Input tags, with fully function sample
    or accept the fact that there is a big mistake with documentation.

    Response it awaited and efforts in this regard would be highly appreciated.

    Best regards

    Mahesh


    admin
    Keymaster

    Hi Mahesh,

    I suggested you to check working samples available online. If you would like to use a different approach, then that is OK, too. However, we do not have an example with your use-case i.e we cannot test what happens on your side. Could you share jsfiddle.net or codepen sample?

    Best Regards,
    Peter Stoev

    jQWidgets team
    https://www.jqwidgets.com

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.