0

I have 6 forms, and 6 links on one page. All forms are set to display none, when the corresponding link is clicked the form appears.

When the submit button is clicked, the page is reloaded and all the forms disappear like originally set. Is there a possible way to identify one form to remain visible throughout the post reloads when that button is clicked?

Would query strings be my best option or is there an easier approach? Below is a function i created to handle the query strings, am I going too far with this? (conditional to set inline style on page load)

function check_status($key) {
    if (isset($_GET["status"]) AND $_GET["status"] == $key) {
        echo 'style="display:block"';
    } else {
        echo 'style="display:none"';
    }
}
4

0 回答 0