NoDoze Posted September 13, 2007 Share Posted September 13, 2007 ok, I know this is possible, but I dunno how to go about doing it.... I have a database of project number, client info, address, phone, ect... And I have a form to add data, and one to edit data... On the edit data form, I want to set it up so that when the project number is highlighted via a pull down list of active project numbers, that project number fill auto fill the form with the clients info from the database. Then, the user can edit this info...and submit the mofifications. Is this done with php, javascript, or ajax? Which is best? I'm pretty sure this could be done with php, but how? Can I get an example of code? a good starting point... any insight, info is helpfull! Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/ Share on other sites More sharing options...
NoDoze Posted September 13, 2007 Author Share Posted September 13, 2007 If no one can answer, can someone at least post a link to some answers or examples? Google isn't cutting it... I feel like I'm going in circles...Maybe I just haven't 'discovered' the correct search words.... Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/#findComment-347981 Share on other sites More sharing options...
almightyegg Posted September 13, 2007 Share Posted September 13, 2007 Ajax is what you need, I'm not sure how to do it myself being a newbie to ajax, but I had found a script online previously that did exactly this yet I can't seem to find it now... sorry I couldn't be more help Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/#findComment-347985 Share on other sites More sharing options...
Jessica Posted September 13, 2007 Share Posted September 13, 2007 You want ajax. Check out mootools.net Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/#findComment-347986 Share on other sites More sharing options...
NoDoze Posted September 14, 2007 Author Share Posted September 14, 2007 Hmmm....I'm a newbie to ajax...looks cool, but complicated... If I create a pulldown menu of project numbers... then based on the number that is picked, can't I get it to query the info already in the database and populate the form with the data? But with this method I'd need to know #1 how to create a pulldown query, and #2 how to populate the fom fields with the data from the database based on the query. Can someone help me with examples? Like I said ajax looks cool...but I can't find anything newbie enough to explain it and get me going... Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/#findComment-348507 Share on other sites More sharing options...
solarisuser Posted September 14, 2007 Share Posted September 14, 2007 www.zapatec.com look at their ajax form, its made for newbs and does what you want and more Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/#findComment-348528 Share on other sites More sharing options...
NoDoze Posted September 14, 2007 Author Share Posted September 14, 2007 zapatec looks good, but a pay option... I need this free... we're an org.... ...hehe...hence the newbie doin the work Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/#findComment-348611 Share on other sites More sharing options...
Psycho Posted September 14, 2007 Share Posted September 14, 2007 If you want someone to write this for you, post int he freelance forum. We are here to help, not do it for you. You need an AJAX solution. That does not mean you need to write queries into the select list. Here is one process for accomplishing this: 1. When page first loads query the database for the list of projects by ID and possibly a description. Take that list and populate the drop-down with the ID as the value and description or ID as the label. The first item in the list shuld have a null value and a label of "Select a project". Include an onchange event for the select list which calls a javascript function and passes the project numeber. 2. Create a JS function that takes a project ID and makes an AJAX call to a PHP page. That page will return back the data for the specific project and then the rest of the JS function will populate the form. 3. Create a PHP page which will accept a variable ($_GET) for a project ID and then returns back the field data for that project ID. Quote Link to comment https://forums.phpfreaks.com/topic/69232-populate-form/#findComment-348642 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.