Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I'm working in a small php project.

I've created several pages and all of them have 3 areas:

FILTER FORM
ORDER FORM
RESULTS FORM/TABLE

The first form will be used to apply filters to the results one.
The second form will be used to select an order to show those results.
The third one will show the results.

This said... my stupid problem is that once I post one of the forms the contents of the other one get lost... so I can filter OR order but not both.

How would you solve this issue?

I've thought on storing all the variables in the SESSION and then overwrite the variables with the session ones at the beginning... but I don't know if there is a better way to do it.

Thank you very much for your guidance.

What I have tried:

Not much... just discovered the issue, tried to find out if I can send two forms at once, but seems it's impossible...
Posted
Updated 30-Aug-19 7:55am

1 solution

You ought to look up AJAX and use it from your page.

Also, if using AJAX, you really don't use forms - you do sent the same data but you do it using references to the control's id via document.getElementByID()

Ajax lets you do whatever you need to on the serverside and update your current page WITHOUT refreshing it (which forms do).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900