473,738 Members | 8,848 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Values for DropDowns

4 New Member
I have a page with all form field to take input from user.
ex : when user selects a Country automatically all the states within that country should be populated in second list box with values(states) fetched from database.
and if I select state again all the cities under this state would appear in 3rd drop down.. like that...

I know Ajax will do this thing.. But can anyone point me to the sample code..
Sep 27 '12 #1
5 1592
DroidSlave300
3 New Member
What platform are you working with? .NET, PHP, Other?
Sep 27 '12 #2
ynaveen9
4 New Member
am using Perl/CGI. Can you point to me some sample code for this purpose?

Thanks a bunch!
Sep 27 '12 #3
Fary4u
273 Contributor
i think best to use ajax or java script as passing values to perl or cgi.
Sep 27 '12 #4
ynaveen9
4 New Member
Thanks Fary4u for ur reply. Do you have some simple/sample code to show in for the same? I searched in web but all are confusing for a beginner like me.
Sep 27 '12 #5
Fary4u
273 Contributor
give you idea to start with is.
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT>
  2. function checkLink(s) {
  3. var val = escape(s)
  4. var val = form1.dropdown.options[form1.dropdown.options.selectedIndex].value;
  5. </script>
  6.  
you can write like this.
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("result").innerHTML = val;
  2.  
Sep 27 '12 #6

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

Similar topics

3
2197
by: Kingdom | last post by:
I don't want to try and reinvent the wheel so I'm looking for an ASP 3 script that will dynamicaly populate a nubmer or dropdown boxes from an access database, read a price from the the database and write both the selection and the price to a form and total all the prices too. Any help apreciated, any other features a bonus, eg display images etc.
4
2575
by: cwwilly | last post by:
Hello, Thanks for taking a look at this! Problem: I'm trying to pass multiple dynamic values between a slaveform and a masterform. The problem I'm having is on the slaveform I loop through multiple records and want two values depending on the row they select. slaveform: x=selected
1
1444
by: John Smith | last post by:
I have a stored procedure that expects a month and year. There are times when I simply want to pass the current month and year (instead of, say, a querystring value). How can I pass the current month and year as the defaultText attribute value inside a <selectparameters> tag? Thank you!
1
1122
by: Yusuff | last post by:
Hi I guess this must be easy, But I am banging my head since last 2 days. I am attaching an envelope schema to the body of my message. Right now I am able to give static default values to it. But I need to pick up the message ID and add it to my message id tag in the envelope.
1
3666
by: PraveenAnekalmat | last post by:
Hi everyone, I'm using anchor within the for loop which means the number of anchors(links) dynamically varies. Within the anchor i'm calling one javascript function and passing the dynamic value (select ) in that. The problem is even i click any link only last value i.e..select value at i = j is passing because the looping will happen during loading the page itself...so how can i pass exact values? Do i need to set any ID for the tag?If so...
4
1962
by: chikkypdr | last post by:
I am new to Access coding , if anyone can help me it would be great I have a patient table with fields like Firstname, lastname, DOB etc. I have a combo box (cbName) on my form to search for a patient. Whenever a user enters the first letter in the combo box , it should be populated with the patient names whose firstname or lastname starts with that particular letter. And when the user enters second letter it should narrow the search...
2
1398
by: bharathi228 | last post by:
my code for retrieving values from database Dim da As New SqlDataAdapter("select parameter_name,parameter_units from sys_params", con) If con.State = ConnectionState.Closed Then con.Open() End If Dim ds As New DataSet Dim name, unit ,namunt As String da.Fill(ds, "sys_params")
2
2929
Cintury
by: Cintury | last post by:
This is my first time utilizing the switch statement and I was wondering if it was possible to return a dynamic value for any conditional expression of the statement. E.g. my values are based data from a table which varies depending on the record the switch is calling against. Switch( = 0, !, = 1, !, = 2, !, = 3, !, = 4, !, = 5, !, = 6, !, = 7, !, = 8, !)
3
1785
by: techbytes | last post by:
hi, In my Project,i have an 2 dropdowm.Based on the value of the first,second dropdown is populated. Based on the output of the 2 dropdown ,I have to display details below the dropdown. I have populated dynamic value in 2 dropdown. I donotknow how to get the details based on the 2 dropdown.
1
1335
by: blurryanthem | last post by:
Hello, I am trying to create a program that would replicate different selected files "x" times into a specified directory and save them with filename indexes. Then after create a log list of the successfully copied files via LogListBtn click ( maybe saving the text file in the C: root) ex. a. Help.txt ( copy 3x ), Report.xls ( copy 2x ) When they are saved in a specified directory they should look like: Help(1).txt
0
8969
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
8788
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9335
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
9263
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
8210
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
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();...
1
3279
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
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.