[SalesForce] Carrying “qs” parameter with form submission on landing page

I'm creating a custom profile center using landing pages and ampscript.

When I submit my form to itself the data is properly processed with ampscript. But the "qs" parameter is no longer available in the URL and therefore I have no means of returning the subscriber to a personalized page. I tried doing a RequestParameter("qs") and QUERYPARAMETER("qs") to retrieve the value and pass it on to the submission page but I seem to be unable to capture that value.

Is there a better way to pass or retrieve this value after submitting a form?

Thanks,

Best Answer

Just exclude the action parameter of the <form> altogether. When no action is present browsers will submit to the current documents address.

 <html>
    %%[
        IF RequestParameter("submitted") == "submitted" THEN
            Output(Concat("Form submitted with ", RequestParameter("var1")))
        ENDIF
    ]%%
    <body>
    MID hidden in QS: %%memberID%%
        <form method="post">
            <input type="text" name="var1"/>
            <input type="hidden" name="submitted" value="submitted"/>
            <input type="submit">
        </form>
    </body>
</html>

This will leave your QS parameter as it was when the Subscriber first hit the page; so if you use MicrositeURL AMPscript function with additional parameters, it'll always be passed.