SephirGaine Posted August 14, 2006 Share Posted August 14, 2006 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! Link to comment https://forums.phpfreaks.com/topic/17554-auto-fill-in-a-form/ Share on other sites More sharing options...
GingerRobot Posted August 14, 2006 Share Posted August 14, 2006 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. Link to comment https://forums.phpfreaks.com/topic/17554-auto-fill-in-a-form/#findComment-74763 Share on other sites More sharing options...
SephirGaine Posted August 14, 2006 Author Share Posted August 14, 2006 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. Link to comment https://forums.phpfreaks.com/topic/17554-auto-fill-in-a-form/#findComment-74764 Share on other sites More sharing options...
GingerRobot Posted August 14, 2006 Share Posted August 14, 2006 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. Link to comment https://forums.phpfreaks.com/topic/17554-auto-fill-in-a-form/#findComment-74767 Share on other sites More sharing options...
SephirGaine Posted August 14, 2006 Author Share Posted August 14, 2006 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! Link to comment https://forums.phpfreaks.com/topic/17554-auto-fill-in-a-form/#findComment-74768 Share on other sites More sharing options...
GingerRobot Posted August 14, 2006 Share Posted August 14, 2006 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. Link to comment https://forums.phpfreaks.com/topic/17554-auto-fill-in-a-form/#findComment-74769 Share on other sites More sharing options...
SephirGaine Posted August 14, 2006 Author Share Posted August 14, 2006 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! Link to comment https://forums.phpfreaks.com/topic/17554-auto-fill-in-a-form/#findComment-74780 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.