Solved

PHP <select> and onchange question

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mysql between clause 2 21
Attach to file (img) a unique id 8 23
Showing random records from database 10 36
Eloquent ORM manual paginator defaults to simple 2 19
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

813 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