Ajax advice needed - Add item to session, appears on screen
Posted: Wed Jul 23, 2014 5:35 am
I'm about to begin writing a page where customers can buy this particular item, but 'build' it entirely to their requirements.
ie. buying a car:
buy shell
select stereo
select steering wheel
select leather color
... and so on.
It will all be in the one screen. I can expanding and contract the levels that appear, but I need to be able to click one item from the list, and it "magically" appear via Ajax (I think?!) on the right. So at the end of the 'run', they see each of their items in a column on the right, taken from the lists on the left.
I'm thinking it would be added to a SESSION. But what I am not sure about is it to make it appear.
If there were say 10 lists of items to pick from, do I need 10 *.php files that run each result from the Ajax query?
If I do, I know how to make AJAX work via "on keyup" such as in a web site's search, but not how to do it it via a hyperlink, or even an onSubmit (if I faked a form button).
So here's lies my question:
Is my theory above a good way to do this?
If yes, how do I do it, specially with some form of onclick to send data to AJAX?
Many thanks.
ie. buying a car:
buy shell
select stereo
select steering wheel
select leather color
... and so on.
It will all be in the one screen. I can expanding and contract the levels that appear, but I need to be able to click one item from the list, and it "magically" appear via Ajax (I think?!) on the right. So at the end of the 'run', they see each of their items in a column on the right, taken from the lists on the left.
I'm thinking it would be added to a SESSION. But what I am not sure about is it to make it appear.
If there were say 10 lists of items to pick from, do I need 10 *.php files that run each result from the Ajax query?
If I do, I know how to make AJAX work via "on keyup" such as in a web site's search, but not how to do it it via a hyperlink, or even an onSubmit (if I faked a form button).
So here's lies my question:
Is my theory above a good way to do this?
If yes, how do I do it, specially with some form of onclick to send data to AJAX?
Many thanks.