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

558
Vistas
How do I put an asterisk for mandatory fields?

how do I put a red asterisk on a mandatory field ? For example title, location, Name, Email (for Owner section), Name,Email are required (*) and the Age and Location are optional

export default function App() {
  // ...
  return (
    <div className="flex flex-col">
     
      <form onSubmit={handleSubmit}>
        <span className="mr-3 h-6 text-md font-bold  leading-8 text-gray-500">
          Title:
        </span>
        <input
          type="text"
          value={title}
          placeholder="title"
          onChange={(e) => setTitle(e.target.value)}
        />
        <span className="mr-3 h-6 text-md font-bold  leading-8 text-gray-500">
          Location:
        </span>
        <input
          type="text"
          value={location}
          placeholder="Location"
          onChange={(e) => setLocation(e.target.value)}
        />
    //...
  );
}

Here what I'm saying in a picture : enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Give all of your label elements a class of required and add the following to your CSS:

.required::after {
    content: " *";
    color: red;
}

working example:

form {
    display: flex;
    flex-direction: column;
    width: 300px;
}

.required::after {
    content: " *";
    color: red;
}
<form>
    <label class="required" for="name">Name</label>
    <input id="name" class="field req" type="text" required>
</form>

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