I am creating a form in which a user selects an event from a <select> menu and if the event is password protected, a code box will appear below.
The problem is that the list is generated from the server on a mysql page. What I am trying to do is make the box appear only if it is password protected. My first idea was to set the value of the protected options to "protected" or something similar, but this won't work as I will lose the value it is supposed to be.
I think that's the best option, personally. You could also do it by assigning non-standard tags to the various options.
After doing some searching, I came across in_array(), and I am going to try to use the generated array with the protected values and the in_array() function to check if the selected value is in the array.