Solved

PHP <select> and onchange question

Posted on 2004-08-14
3
710 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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.

687 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