locked
Jquery DataPicker RRS feed

  • Question

  • User-797751191 posted

    Hi

    how to input date using jquery datepicker in dd-mm-yyyy and save in sql using c# . In Sql i have DataType Date of a field.

    Thanks

    Monday, July 15, 2019 1:15 PM

Answers

  • User475983607 posted

    jsshivalik

    how to input date using jquery datepicker in dd-mm-yyyy and save in sql using c# . In Sql i have DataType Date of a field.

    Your other thread shows that you already know how to format the date when the user makes a selection from the calendar. 

    https://forums.asp.net/p/2157770/6270384.aspx?Input+string+is+not+in+correct+format

    The format is not working?

    If you are trying to force the user to enter a specific date when using the keyboard, then use standard ASP Validation controls.

    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:RegularExpressionValidator 
            ID="RegularExpressionValidator1" 
            runat="server" 
            ErrorMessage="RegularExpressionValidator" 
            ControlToValidate="TextBox1" 
            ValidationExpression="^([0-2][0-9]|(3)[0-1])(-)(((0)[0-9])|((1)[0-2]))(-)\d{4}$"></asp:RegularExpressionValidator>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </div>
    



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 15, 2019 1:23 PM