473,474 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dynamic dropdowm list

4 New Member
how can i get data from a database into my dropdown list in a html form and
and if i select from the first dropdown list the second dropdown load from the database the crosponding value of the first one dropdown
Feb 27 '07 #1
3 1599
r035198x
13,262 MVP
how can i get data from a database into my dropdown list in a html form and
and if i select from the first dropdown list the second dropdown load from the database the crosponding value of the first one dropdown
You could try loading the data into hidden selects and then use Javascript to play around with the autopopulating ...
Feb 27 '07 #2
anuragpj
32 New Member
You could try loading the data into hidden selects and then use Javascript to play around with the autopopulating ...
You can try this after connecting to the database
[HTML]<input name="select">[/HTML]
[PHP]$connection=pg_connect("host=fasfd dbanme=gfd user=fda");
$myresult= pg_exec($connection, "select field_name from table_name");
for ($lt=0, $lt<pg_numrows($myresult); $lt++){
$var=pg_result($myresult, $lt, column_name);

echo "<option>$var<option>";
}[/PHP]
Feb 27 '07 #3
r035198x
13,262 MVP
You can try this after connecting to the database
[HTML]<input name="select">[/HTML]
[PHP]$connection=pg_connect("host=fasfd dbanme=gfd user=fda");
$myresult= pg_exec($connection, "select field_name from table_name");
for ($lt=0, $lt<pg_numrows($myresult); $lt++){
$var=pg_result($myresult, $lt, column_name);

echo "<option>$var<option>";
}[/PHP]

Perhaps you'd then have
[HTML]<select name="myValues" onChange="autopopulate()">[/HTML]

Then have the js function populating another dropdown with values that depend on the currently selected values from the database
Feb 27 '07 #4

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

Similar topics

6
by: Vasileios Zografos | last post by:
Hello, I have a function that generates some values (e.g. vertices in 2d space) the number of which I dont know. So, it could generate 20 vertices, 100 vertices, or even 1 vertex. void...
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
5
by: swarsa | last post by:
Hi All, I realize this is not a Palm OS development forum, however, even though my question is about a Palm C program I'm writing, I believe the topics are relevant here. This is because I...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
20
by: sirsnorklingtayo | last post by:
hi guys please help about Linked List, I'm having trouble freeing the allocated memory of a single linked list node with a dynamic char* fields, it doesn't freed up if I use the FREE()...
1
by: jmartmem | last post by:
Greetings, I have a nagging problem with client-side dynamic dependent list boxes that perhaps someone can help me troubleshoot. I have a form with a series of dynamic dependent list boxes....
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
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.