I don’t how to resolve this situation. I have this first dropdown menu with ID = PK1. I will force it to some value which goes off with cgi.perl and alters the second drop down menu with ID=#PK1_DEVICE_NAME_SELECTION based on some mysql lookup.
My coding below to force the val(‘$TEMP{DEVICE1_NAME}’) doesn’t work!
If I put an alert between the middle these 4 lines, it works. How do I resolve this?
// FORCING VALUES FOR THE DROP DOWN MENU 1
\$("#PK1").val('$TEMP{PDK1}');
\$("#PK1").trigger('change');
\$("#PK1_DEVICE_NAME_SELECTION").val('$TEMP{DEVICE1_NAME}');
\$("#PK1_DEVICE_NAME_SELECTION").trigger('change');
Put it in your ajax callback. Something like this: