473,378 Members | 1,377 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,378 software developers and data experts.

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 2598
"R.G. Vervoort" <ro**********@royvervoort.nl> schrieb im Newsbeitrag
news:40*********************@news.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**********@royvervoort.nl> wrote in message
news:40*********************@news.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.javascript

PointedEars
Jul 17 '05 #4

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

Similar topics

1
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...
3
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...
1
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...
1
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...
2
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...
3
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...
1
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,...
3
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 :) ...
4
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.