Skip to main content
Inspiring
March 20, 2024
Question

Problem with javascript code in a form

  • March 20, 2024
  • 1 reply
  • 1069 views

Hello, I have a form where I have a list of people and each one has a code, I want that when selecting a person in a text field, the code of this person is automatically placed in another text field. That is, make them conditional. I have this code and it doesn't send me an error but it doesn't work and it only gives me the last code I wrote. Is this possible to do? What should I change to make it work? I hope you can help me, thank you.

this is the code:

I have a list of names in a dropdown and when selecting them I want the code of the selected person to be placed in the text box below called "Cédula y/o Nº empleado"

 

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
March 20, 2024

To test values use == , not only =

Inspiring
March 20, 2024

I'm not very expert in javascript, I placed it this way and it still doesn't work

When selecting one of the two names that I entered, nothing happens nor do the codes change, the last code "SOF-0574" is simply displayed

Inspiring
March 20, 2024

I also tried this way but it still doesn't work