473,404 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Drop down Event which calls php scripts

Hi,

I have a drop down whose values are as follows and will be stored in a sql table:
-one
-two
-three

When a value is selected in drop down then a certain list has to be displayed which needs to be pulled from sql table... list will vary based on selection...
e.g., When one is selected then display following items:
1] one
2] one one
3] one one one

I am new in php so please guide me how to make this happen or please provide a sample code....

Thanks and Regards,
Vaibhav
Aug 30 '08 #1
1 1104
Hi,

I have a drop down whose values are as follows and will be stored in a sql table:
-one
-two
-three

When a value is selected in drop down then a certain list has to be displayed which needs to be pulled from sql table... list will vary based on selection...
e.g., When one is selected then display following items:
1] one
2] one one
3] one one one

I am new in php so please guide me how to make this happen or please provide a sample code....

Thanks and Regards,
Vaibhav
You can do this through AJAX.

Another way is
if page refreshing wont matter that much then you can simply pass the value to the query.
Expand|Select|Wrap|Line Numbers
  1. <form name="myform" id="myform" action="" method="get">
  2.  
  3. <select name="mydropdown" id="mydropdown" onchange="sortby_form.submit()" >
  4.  
  5. <option value='one'>One</option>
  6. <option value='two'>Two</option>
  7. <option value='three'>Three</option>
  8.  
  9. </select>
  10.  
  11. </form>
  12.  
So when any value is selected from the dropdown menu, form will be submitted and the $mydropdown will be passed. You can use this value in your query.
Aug 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la...
5
by: EviL KerneL | last post by:
Hi - I am trying to figure out a way to enforce the validation included for this form based on whether the user chooses "email" or "phone" as the contact choice. Right now it is set to enforce...
1
by: M.L. | last post by:
Hi NG, I hope someone in here is able to help me in this matter. The problem: I have created a Javascript drop-down menu which expands when moving the mouse into a tablecell (calls my Expand()...
2
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of...
3
by: excel_hari | last post by:
Hi, I couldnt locate a Classic ASP group hence posting here. One of my colleagues has designed an intranet site and one of the pages has a drop-down box with close to 300 options. I want to...
4
by: teknoshock | last post by:
I have created a page with multiple drop down boxes, all populated with the same options. My problem is, for 12 dropdown boxes and 40 choices per box, I end up with a massive file. Also, if I...
6
by: zacks | last post by:
I have an application I am developing that has a Combo Box that is intended to show a list of available tables in the selected DSN. I have put code in the control's DropDown event handler to clear...
3
by: amcoldspy | last post by:
Hi, am trying to create dynamic drop down boxes.. there are 3 drop down boxes. The second drop down box elements are to be update based on the selection made in the first drop down box...
3
by: - HAL9000 | last post by:
I am trying to get an event when the drop-down Combo Box goes away / reverts back to showing a single item. For example, clicking the box's down arrow, to remove the drop-down window, doesn't...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.