473,662 Members | 2,596 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filtering a dynamically created table from a dropdown list

Tann3r
2 New Member
Apache.v2.2.4, MySQL.v5.0.27, PHP5.2.1

I have a table of projects which has been dynamically created from an SQL query. I have several dropdown boxes which have been populated from other tables within the database and i would like to filter the information shown in the main table dependant upon the items selected in the dropdown list(s). I assume that this needs to be done using java to enable the list to be refreshed as soon as a dropdown item is selected without the need for a submit button to be used.

Any help would be greatly appreciated

Regards

Tann3r
Mar 13 '07 #1
5 3437
r035198x
13,262 MVP
Apache.v2.2.4, MySQL.v5.0.27, PHP5.2.1

I have a table of projects which has been dynamically created from an SQL query. I have several dropdown boxes which have been populated from other tables within the database and i would like to filter the information shown in the main table dependant upon the items selected in the dropdown list(s). I assume that this needs to be done using java to enable the list to be refreshed as soon as a dropdown item is selected without the need for a submit button to be used.

Any help would be greatly appreciated

Regards

Tann3r
You don't need Java to do this. Javascript will do just fine.

Let me move you to the Javascript forum then where hopefully you wont get moved to the PHP ...
Mar 14 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Apache.v2.2.4, MySQL.v5.0.27, PHP5.2.1

I have a table of projects which has been dynamically created from an SQL query. I have several dropdown boxes which have been populated from other tables within the database and i would like to filter the information shown in the main table dependant upon the items selected in the dropdown list(s). I assume that this needs to be done using java to enable the list to be refreshed as soon as a dropdown item is selected without the need for a submit button to be used.

Any help would be greatly appreciated

Regards

Tann3r
Yes, you can do this using dynamic select options, see link. Or you can use Ajax to connect to the server and return your data onchange.
Mar 14 '07 #3
Tann3r
2 New Member
Yes, you can do this using dynamic select options, see link. Or you can use Ajax to connect to the server and return your data onchange.
Thanks for the response so far, just to clarify a little if needed...

The MySQL query returns values which i use to populate a table which is automatically shown when the index.php page is loaded. I would then like to filter these results using 1 or more dropdown boxes (for example if the engineer looking at the page wants to view only his own projects and/or projects for a specific client)
I would like this to happen as soon as the option is selected from the dropdown box, without the need to use an action button.

I can make the site available for you to take a look if you need more information

Thanks
Tann3r
Mar 14 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
Yes, post the code or a link.

You can use the onchange event handler so that you don't need an action button.
Mar 14 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
In your form select dropdown tags, add the following:
Expand|Select|Wrap|Line Numbers
  1. onchange="this.form.submit();"
Mar 20 '07 #6

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

Similar topics

1
5242
by: mstery | last post by:
I have a report generated via an ID selection made in a dropdown on a form. The report filters by an on click event in a preview report button on the form. Everything in the report, including subreports, filters perfectly, with the exception of a running sum DLookup field on the main report. This field looks up a value in a foreign table. I'm not clear where I'm supposed to be filtering this field, since it obviously isn't picking up the...
8
3381
by: utterberg | last post by:
Hi I'm adding two dropdownlist in my webform by clicking a button. I fill the first dropdown with some values from my DB and the other one when I choose from the first dropdown. But since theese dropdownlists are created by clicking a button they no longer exists on my webform. How do I keep my dynamically created dropdown when using OnSelectedIndexChanged? Can anyone help me solve this problem? Or is there a better way of doing this?
5
1961
by: Sosh | last post by:
Hi, I can't seem to find much information on this. Please could someone explain to me how to wire up events (selectedIndexChanged) to a bunch of dynamically created controls (Dropdownlists), preferably in C#. I'm sure this should be relatively straighforward, but can't for the life of me figure out a good way of doing it. Many thanks!
7
14802
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
9
7035
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related to VB, plus the address bar would show something like this: www.somethinghere?id=3 and if you change number 3 from the address bar to (for example) 34 or 71 you would get different page with the same formatting like I.e: www.somethinghere?id=34...
4
2708
by: assgar | last post by:
Hi I am stuck on a problem. I use 3 scripts(form, function and process). Development on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. The form displays multiple dynamic rows with chechboxs, input box for units of service, description of the service and each row has its own dropdown list of unit fees that apply.
5
1495
by: arnabit | last post by:
I have created a dropdown ,which is inside a panel and the panel is inside a place holder . the panel and the dropdown is created dynamically. I do have a button when the button is clicked i am trying to read the values from the dropdown.but the problem i am facing is that i am not getting the id of the dropdown .Please advice me how to get the id of the dropdown .
21
29771
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays prodcut anme have used ajax to avoid refreshing of page this works fine 2.now i have created one row with checkbox|select box|text|text|text|text| where in the select box values are fetched from table here also i have used ajax for getting the m_name...
3
2997
by: balurajeev | last post by:
Hii, currently i am working on an apliction(ASP.NET/C#) that creates dynamic html rows which contain six html text boxes and a html dropdowllist. At the time of page load the web page contain six server side text boxes and a serverside drop down list. and a html "Addrow" buton which create client side textboxes and dropdown list dynamichally Now i am meeting a problem of passing values from dynamichally created html controls to Server Side...
0
8435
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.