Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
How to only current date enable in input date type in C# or JavaScript

I am trying enable only current date but disable future dates. Please help me.

Ny code:

txtshiftdate.Attributes["min"] = DateTime.Now.ToString("yyyy-MM-dd");

ASPX Code:

<asp:TextBox type="date" TabIndex="3" CssClass="form-control" runat="server" ID="txtshiftdate" />
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you want to check if a date that is entered in the textbox is within a certain range, you should write the validation code in the OnTextChanged handler for example:

<asp:TextBox ... OnTextChanged="txtshiftdate_TextChanged">

In the handler, you should parse the input and change it for to the corrected value if necessary.

protected void txtshifdate_TextChanged(object sender, System.EventArgs e)
{

    txtshiftdate.Text = DateTime.Now.ToString("yyyy-MM-dd");
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda