Jump to content

[SOLVED] Form Data


zenix

Recommended Posts

Hello, I have been working hard this past year trying to learn php and mysql. I've even developed my own little database of contacts. Anyway, I thought it'd be neat (if possible) to have a textarea on the page my data form is on to display the first, last names and phone numbers of the contacts in the db, then have it so all I have to do is scroll through the list and click the one I'd like to have displayed in my form.. I don't know how to do this. My database works great, I just thought this could facilitate a little more learning...and it would be a nice addition.

 

If anyone has any idea on how I might achieve this I'd really appreciate it if you'd let me know. Thanks!!

Link to comment
Share on other sites

I appreciate your input, thank you. My problem isn't the database...I have THAT working quite well. I would just like to see if I can have the names and maybe phone number of the contacts displayed in a text box so I can click on one and have all the information (address, phone, email etc...) appear in the form.

Link to comment
Share on other sites

Thank you again, I'd actually like to know how to make it so I can click on an entry in the text box and have the fields populate with the associated data. I'd probably more of an AJAX or Javascript issue I guess. I was just hoping to be able to do it with php.

Link to comment
Share on other sites

PHP is a server side scripting language and cannot effect anything client side. Ajax is basically a technique that allows JavaScript to communicate with PHP to sort of fake a true synchronous communication. You will not be able to do it without using Ajax unless your ok with submitting a form everytime you wish to change the page. You wouldn't really want to design it in a way that would have you clicking in a textbox, you'd really want either a search box you type in or a dropdown box.

Link to comment
Share on other sites

A textbox should really be used for inputing or editing text. If you wanna display text, just use plain text. If you wanted a list of items to select from and a dropdown box isn't the look your after you could have a list of anchor links (<a hrefs) or whatever. Either way, symanically or asthetically a textbox really isn't a good way to have a menu per-se.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.