Solved

PHP <select> and onchange question

Posted on 2004-08-14
3
706 Views
Last Modified: 2012-08-13
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?


0
Comment
Question by:mawdryn
  • 2
3 Comments
 

Author Comment

by:mawdryn
ID: 11799769
I've managed to get it working with a submit button, however is there a way to get it to work using onchange?
0
 
LVL 3

Accepted Solution

by:
Yasir_Malik earned 125 total points
ID: 11801139
In the onchange function handler, you could do "document.your_form.submit()", and that would be the equivalent of using the submit button.
0
 

Author Comment

by:mawdryn
ID: 11802688
Thanks Yasir, that did the trick :)
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question