Click to See Complete Forum and Search --> : Help with a Big PHP Form


Raskii
09-15-2001, 12:15 AM
I'm working on a form that acts as a shopping cart but I have some problems.

Note, I've set up a little "demo" (it's not actually a real form) that shows kind of what I want. It's at http://www.hcweb.net/mikenune/test/TestForm1.1.html

EDIT: Click the add button so see the form change.

First: I want to make the form dynamic. What I mean by that is I want the form to start out with only one line where you can choose an item (book, video, software, etc.) and one line for the total price. Once an item is chosen, the form adds another line where they can add another item (so now there's two lines for items and one line for the total. I want to be able to do this as many times as necessary. I also want the form to remove lines if the use deletes an item (and, if there's anything below that line, to shift all the others up one).

Second: Because of the size of the list (it's going to be sorted alphabetically to aid searching), I don't want to have to load 15 bazillion lists. I want the use to click on an "add" button that will bring up another window with the list. The problem is; how do I pass the information back to the "parent" form once they've made a selection? Also, can I update the "parent" form without reloading the page?

[ 15 September 2001: Message edited by: Lucefiel ]

Col. Panic
09-15-2001, 12:33 AM
Pssst! Maybe it's just part of the demo, but I tried to buy one copy of PHP in a Nutshell, but you sold me 15 copies of Self Help!

Anyway, I could be wrong, but I think to do it without refreshing the main window, you're going to have to use some JavaScript in there. Since PHP is server side, it can't respond to the changes you're making without being asked to do so.

But what do I know? :D Good luck!

Raskii
09-15-2001, 12:55 AM
Originally posted by Col. Panic:
<STRONG>Pssst! Maybe it's just part of the demo, but I tried to buy one copy of PHP in a Nutshell, but you sold me 15 copies of Self Help!</STRONG>

LoL! It's not actually a form yet. Right now, it's just set up as an example of how the page should change as you add items.

Also, even though it works in Netscape, IE makes it look a little better (non-standardized css stuff).