Is there an easy way to populate a list dynamicly? It stinks javascript here, but I don't know how to do it with that either. I have one list A that contains enteries with ID's as values. List B should then fill with information from a database according to wich ID is choosen in list A. Since alot of otherthings is entered on the page to I would like to nopt have to deal with sending all the data and loading the same page again. Is there a way in PHP to link to the same page and have all the filled textfields stay as they were? Or do I have to use post?

I have the thought of loading all the data from the database and having it in an array or something and having a javascript picking and writing the choosen ones to the list. But that would be alot of excess data so getting it "live" from the db would be better.

    There's a thingy called AJAX, but that would involve even more Javascript as well as PHP.

    Remember. PHP runs on the server. Not on the client. If you want something to happen on the client, then PHP can't do it on its own.

      No... I know PHP runs on the server. But I was hoping that there might be a function (or a type of link) that reloaded the page again and had all the data written intact so I could use it to populate the list. Well, I guess I will have to post the page and retrive the data once a selection has been made.

        Comming to think about it I think AJAX might be the way to go. Looked at it and it doesn't seem that hard and can be a nice thing to know anyway. Thanx for the info m8.

          if you didnt know:
          <form name="xyzform" method="post" action="<?php echo $PHP_SELF ; ?>">
          will reload the page with text intact (and you could do another Select from the users response at the same time)

            AJAX is great, and it could definitely do what you need. Try your hand at it and post back - I can certainly help you with it!

              Write a Reply...