Solved

PHP <select> and onchange question

Posted on 2004-08-14
3
708 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

730 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