473,562 Members | 3,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

filling out textfields using a pulldown to select an mysql databaserecord

I would like to select an option in a pulldown, select a record in a mysql
database depending on the pulldown selection and then put the data from the
record in the textfields.

I can retrieve the pulldown value using javascript

I can open the database and select the record using php

how can i combine the 2 to within the onchange option of the pull down.

Any suggestions welcome because i am getting crazy with this
roy


Jul 17 '05 #1
3 2603
"R.G. Vervoort" <ro**********@r oyvervoort.nl> schrieb im Newsbeitrag
news:40******** *************@n ews.xs4all.nl.. .
I would like to select an option in a pulldown, select a record in a mysql
database depending on the pulldown selection and then put the data from the record in the textfields.

I can retrieve the pulldown value using javascript

I can open the database and select the record using php

how can i combine the 2 to within the onchange option of the pull down.

Any suggestions welcome because i am getting crazy with this


As Javascript runs on the client and PHP/MySQL on the server you have the
following 2 possibilities:

1. After having choosen the pulldown value you submit the form and display
the page again with the value filled into the textfield by PHP.

2. If you don't want to submit the form you have to bring the database
entries to the client side: write the records from MySQL into a Javascript
array with PHP and then get them from there with Javascript.

HTH
Markus
Jul 17 '05 #2
If I understand properly, you want to use a <select></select> element to
select some given information from a database, but you want to do this
without reloading the page. The short answer is "it can't be done" Once the
page is loaded, it's all there, another HTTP request must be made to run
more processes. If you don't want to reload an entire page you could use an
Iframe/layer.

Hope this helped.

--
Jeremy Jacobs
www.PiercedMedia.com
"Greater men require and desire greater Goals, greater Standards, and
greater Accountability"
"R.G. Vervoort" <ro**********@r oyvervoort.nl> wrote in message
news:40******** *************@n ews.xs4all.nl.. .
I would like to select an option in a pulldown, select a record in a mysql
database depending on the pulldown selection and then put the data from the record in the textfields.

I can retrieve the pulldown value using javascript

I can open the database and select the record using php

how can i combine the 2 to within the onchange option of the pull down.

Any suggestions welcome because i am getting crazy with this
roy


Jul 17 '05 #3
R.G. Vervoort wrote:
I would like to select an option in a pulldown, select a record in a mysql
database depending on the pulldown selection and then put the data from the
record in the textfields.

I can retrieve the pulldown value using javascript

I can open the database and select the record using php

how can i combine the 2 to within the onchange option of the pull down.


You cannot, unless you want to serve the database data along with the
document that contains the "select" element or (re)load the/a new document,
as Markus pointed out. Retrieval of server-side information requires a
(HTTP) request. If you know your target environment, you may want to use
XMLHTTPRequest. Ask Google (Groups).

Excessive crossposting like this without Followup-To is unwished in Usenet.
Especially comp.lang.java. javascript is IMO obsolete, Java != JavaScript.
Please learn how to post: <http://www.faqs.org/faqs/usenet/posting-rules/part1/>
F'up2 comp.lang.javas cript

PointedEars
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1762
by: cgplays.com | last post by:
Are there any good places to look for asp.net modules for select pulldowns? There is a select pulldown on a site i do partial development on http://www.computergroupplays.com/fb-pres4.asp that has a 2 dimensional select pulldown, where the third input box gets filled with the items that match what a user selects in the 2nd pulldown. I want to...
3
4186
by: Mark R | last post by:
I have one .asp page with a SELECT pulldown list on it and some INPUT fields. When SUBMIT is clicked the form data is submitted to that same page and validated. If INPUT fields are empty the asp code will insert a visual indicator (e.g. *) to convey that the field must be filled in. However, if the user has made a selection in the pulldown...
1
1968
by: J. Muenchbourg | last post by:
I have 3 select pulldown boxes where a user will select a year (either 2002 or 2001), a week (one thru 52), and a database (short data or long data). But if a user selects a week that is less than 4, the 3rd select pulldown will only show the choice of "short data", as they will not be able to select "long data". Is it dynamically possible in...
1
6615
by: cgplays.com | last post by:
I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp that changes the 3rd pulldown (Dbase) depending on what the user enters in the 2nd (Wk). My associate wants the values inside the select box to retain their values after hitting the Go-Submit button when selecting the 3 choices- they want to see the values retained on the...
2
8981
by: Oskar Wild | last post by:
Hello, how do I code it to display a select (pulldown) box only if the user has selected a certain option in another pulldown box? <select name=country> <OPTION value="France" SELECTED>France <OPTION value="Spain">Spain <OPTION value="Portugal">Portugal </select>
3
1166
by: R.G. Vervoort | last post by:
I would like to select an option in a pulldown, select a record in a mysql database depending on the pulldown selection and then put the data from the record in the textfields. I can retrieve the pulldown value using javascript I can open the database and select the record using php how can i combine the 2 to within the onchange option...
1
1838
by: eureka | last post by:
Hi folks, I am working on a webapplication using Jsp and JS. On my main Jsp(Jsp1) I have a table which is created dynamically inside a <divand contains all the backend-table's records as rows, ie as many records in the MySql-table as many rows in my Html- table(say T1).I am creating this dynamic table using a Jsp-scriptlet and I have set a...
3
2872
by: WiseG1rly | last post by:
Hey everyone! I am completley new and I will start off by saying that I am not a programmer - figuring out this search took so long! I am debugging now and would appreciate any help :) Anyways, I am creating a website where I have a database of pet listings in california. Each record lists the Type of Listing (eg. dog grooming or vet) the...
4
3529
by: WiseG1rly | last post by:
Hey everyone! Still working on a site I posted for a while ago. Essentially I have a search function that is populated through by a database in mySQL and PHP. I need a few things to help the finishing touches on this... I need to have a "select all" option in each pulldown menu that will select all rows, and pass them onto the next page so...
0
7576
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...
0
7867
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. ...
0
8095
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...
0
6219
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...
1
5476
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5193
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...
0
3606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2073
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
0
901
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...

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.