Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

278
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!