Jump to content


Photo

Auto-fill in a form..


  • Please log in to reply
6 replies to this topic

#1 SephirGaine

SephirGaine
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 14 August 2006 - 09:16 PM

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!

#2 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 14 August 2006 - 09:21 PM

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.

#3 SephirGaine

SephirGaine
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 14 August 2006 - 09:23 PM

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.

#4 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 14 August 2006 - 09:25 PM

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.

#5 SephirGaine

SephirGaine
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 14 August 2006 - 09:27 PM

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!

#6 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 14 August 2006 - 09:30 PM

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.

#7 SephirGaine

SephirGaine
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 14 August 2006 - 09:49 PM

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!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users