question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stefi
Forum Newbie
Posts: 1
Joined: Mon Mar 15, 2004 4:28 am
Location: Greece

question

Post by stefi »

Hi there.
I was going to ask if there is a way that i can have a form that is passes values through its fields.
As an example i have 2 lists in the same form.
If take a selection to the first one, that has some results over the database. Can i give those results to the second list in the form? As options? In the same page?

Thank u for your time
I also apologize for my bad english.
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Re: question

Post by TheBentinel.com »

stefi wrote:Hi there.
I was going to ask if there is a way that i can have a form that is passes values through its fields.
As an example i have 2 lists in the same form.
If take a selection to the first one, that has some results over the database. Can i give those results to the second list in the form? As options? In the same page?

Thank u for your time
I also apologize for my bad english.
You can do it in one form, but it's easier with frames. Do a frameset that gives you the list in one frame and the results in the other. On change of your list in frame1, update the contents of frame2.

Code: Select all

<frameset rows="50,50">
  <frame name=listframe url="list.php">
  <frame name=resultframe url="result.php">
  <!-- result.php should be able to produce a default list -->
</frameset>
list.php generates your list, with javascript events watching for when the user clicks on a list item. When the user does, it changes the location for resultframe.

Something like:

window.resultframe.location.href = "result.php?" + window.listframe.selectList.value

The syntax may be wildly off, but that's a direction to go with it.
Post Reply