Jump to content

Recommended Posts

Hello everyone, Im trying to do something that involves php/mysql. Anyways I cant really explain what I want to do so I have made an example:

[a href=\"http://www.gameflaw.com/misc/example.html\" target=\"_blank\"]http://www.gameflaw.com/misc/example.html[/a]

What I want is say someone selects a name from the dropdown, the information to fill into the fields below it (state, city, zip, phone etc) depending on the information in the database for that name. Can anyone help me with this? Or lead me towards the right direction to getting this done (tutorial, website etc).
Link to comment
https://forums.phpfreaks.com/topic/6116-help/
Share on other sites

There are 2 ways to do this:

1) in the onchange event of the select box, you call a javascript function that recalls the page with the ID of the user selected and runs the PHP to fill the boxes.
2) You use AJAX to do the dirty work.

Both require Javascript. If you want to avoid Javascript, you'll have to use 2 different forms. One with just the select box and one to deal with the info in the other fields once they get filled in.
Link to comment
https://forums.phpfreaks.com/topic/6116-help/#findComment-22040
Share on other sites

[!--quoteo(post=359754:date=Mar 29 2006, 01:15 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 29 2006, 01:15 PM) [snapback]359754[/snapback][/div][div class=\'quotemain\'][!--quotec--]
There are 2 ways to do this:

1) in the onchange event of the select box, you call a javascript function that recalls the page with the ID of the user selected and runs the PHP to fill the boxes.
2) You use AJAX to do the dirty work.

Both require Javascript. If you want to avoid Javascript, you'll have to use 2 different forms. One with just the select box and one to deal with the info in the other fields once they get filled in.
[/quote]


I don't mind using javascript. On the javascript im not sure what function to call? The ID of the user won't be located on any page (I guess just the edit page however) but other than that just in a the mysql database. Im not sure if it makes sense what im asking? Im new to php so please bear with me. And thanks for the reply.
Link to comment
https://forums.phpfreaks.com/topic/6116-help/#findComment-22048
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.