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

286
Vistas
How to set the values from EasyAdmin using Axios and javascript to fill the input?

I'm using ApiPLatform 3, Axios and EasyAdmin 3. In my form when I choose an institution, all the fields from Address are filled from the choosen institution.

This is how I did ins JS :

selectInstitution.addEventListener('change', () => {
    institutionId = selectInstitution.options[selectInstitution.selectedIndex].value;
    axios.get(`/api/institutions/${institutionId}`).then(response => {
        if (200 === response.status) {

            agendaStreet.value = response.data.address ? response.data.address.street : '';
            agendaComplementStreet.value = response.data.address ? response.data.address.complement : '';
            agendaZipcode.value = response.data.address ? response.data.address.city.zipCode : '';
            agendaCity.value = response.data.address ? response.data.address.city.name : '';
        }
    });
});

Everything work in front but when I submit I've got this error :

An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'institution_address' cannot be null.

And if I dump after the submit I can see my Entity Address to null. I don't figure out why symfony does not set the value.

Any idea ?

about 4 years ago · Juan Pablo Isaza
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