autofill data using php/mysql

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
hi guyz

I have searched google and had no luck. I am trying to create a form
where user enter postcode and address box fills up automatically from
the back-end db.

can anyone guide me on how to do this. An example would be helpful or
maybe few links to related tutorial.

thanks in advance.

Re: autofill data using php/mysql wrote:
Quoted text here. Click to load it

Well, first of all PHP is server side - it doesn't know when the  
postcode box is filled in.  So you'll need some javascript to detect that.

When the user fills in the box you can submit the page back to itself,  
get the postcode and fill in the rest of the info.

The biggest problem is figuring out when the box is completely filled  
in.  If, for instance, you say it must be six characters long, great.  
It's something you can test on.  But what happens if the user enters the  
last character incorrectly and wants to change it?  Now the user has to  
wait for the page to be sent back.

Alternatively, you can send the entire postcode/address info with the  
page and use javascript to sort it out.  But this is likely to be quite  
a bit of data.

In any case - if you want it done automatically, you'll need javascript  
also.  Otherwise just have a "fill in the blanks" button which submits  
the page back to itself and sets the info as above.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline