PHP <select> and onchange question

Hi,

Hopefully a fairly easy question. I have web page that has a form that autofills from a database about a certain company. Some companies have more than one contact. I am hoping that I can use either javascript:onchange or a submit button to display information about that particular contact based on one of the fields in the form (contact name)

I'm using arrays such as "$contact['phone1'][$contactid]" where $contactid  would be 0,1,2,etc depending on the option selected from the dropdown list to display the information about the relevant contact.

Can anyone give me some ideas about how to go about this?


mawdrynAsked:
Who is Participating?
 
Yasir_MalikConnect With a Mentor Commented:
In the onchange function handler, you could do "document.your_form.submit()", and that would be the equivalent of using the submit button.
0
 
mawdrynAuthor Commented:
I've managed to get it working with a submit button, however is there a way to get it to work using onchange?
0
 
mawdrynAuthor Commented:
Thanks Yasir, that did the trick :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.