Jump to content

Archived

This topic is now archived and is closed to further replies.

SephirGaine

Auto-fill in a form..

Recommended Posts

Hey ya'll. This is what I want to do. I've got a form where an employee inserts a customer's information for a work order. Ideally, what I want, is for them to be able to save the information into a database. That's the easy part. However, I'm going to have a drop-down list of all the customers we have saved (once again, easy part), but if they choose one of the customers from this list, it automatically fills in the customer information from the database. However, I'm not sure exactly how to do this.. perhaps this is more of an HTML question than PHP. I know how to do everything except for making the form parts automatically fill themselves in depending on which option they choose. So.. any help/guidance/STFU will help. Thanks!

Share this post


Link to post
Share on other sites
Do you mean that you want to select a customer from a first field which is a drop down box and then it will populate the rest of the fields?

If so, you have two options. You can either select the customer and submit a form and then retrieve the information based on that, or you can use ajax if you dont want to have a form submittal.

Share this post


Link to post
Share on other sites
Ajax, heard of it, not sure what it is. I'll do a quick search, though. I s'pose I can have them submit it and then generate it from there, would probably be quicker (and easier) to populate the fields without having to submit first, though.

Share this post


Link to post
Share on other sites
Well i think it would actually be far quicker and easier from your point of you to have them submit it and generate it from there as the coding is far easier.

But it might be more user friendly to use Ajax.

Share this post


Link to post
Share on other sites
Aye, I might just go both routes. For now, just code it using HTML/PHP and then go back at a later date and use Ajax. Reading up a bit on it right now, it's similar to XHMTL, no? If so I know jack about it.. but hey, less than 3 months ago I knew 0 about PHP as well. Thanks for pointing me in the right direction, though!

Share this post


Link to post
Share on other sites
If you take a look at the tutorials over at www.ajaxfreaks.com when you have the time you'll find that its actually pretty easy to get started with ajax as its mostly cutting and pasting the javascript.

It'll take a little time to get it to do as you want, but its pretty easy to start.

Share this post


Link to post
Share on other sites
Awesome, I'll take a look, thanks. I just found out that I'll end up needing to use it for something else ANYWAYS, but for now I've got the system working OK for what I had originally planned. This'll definitely help me out with the next part, however. Thanks!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.