Dear all,
i have a dropdown field with multiple Names. Each name has an unique email-address and an unique number.
Target: when the user select a name, the corresponding email and number should be filled automatically in separate fields. As read only.
One value - e.g. email-address - is no problem. Just by addressing (calculating) the "separate value" of the dropdown list. But how can i address one more "separate value"?
I hope you understand what i mean... 😉 Thanks so much, tom
I'm going to say that that is a non-standard use of "separate values", but I'm sure others have done similar too. I would use jQuery and when the user is selected, you pass the user ID, via an Ajax call, to a PHP program that looks up the user and returns his/her email address and unique number. The jQuery code then sets the value of the two read-only fields to the values returned by the Ajax call. Another option, using jQuery without the need for Ajax is change your "separate values" to be "email_address[some delimited]unique_number", e.g., [email protected]|456. When the user selects a value, you can use jQuery to split the string by the delimiter and assign the values to the read-only fields. That being said, two things: 1. I'm not clear how you set up your separate values in the first place and 2. There may be a way without any custom code, and I'm not thinking of it.
thank you so much. I will try the "delimiter"-way 🙂
Please login or Register to submit your answer