Solved

PHP <select> and onchange question

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now