Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

FROM method="GET" - recomendations


Go to End


3 Posts   881 Views

Avatar
JonShutt

Community Member, 244 Posts

26 August 2012 at 10:05pm

Hi all,

I have a search form on a site, and i'm passing the form through to a certian url using:

$form->setFormAction('/home/search');

All good, but I want the search criteria to be in the URL, so that if the user book marks, 'likes' or links to the results, it all works. So, I use
$form->setFormMethod('GET');

However, the URL now includes "SecurityID=6f9fd5058086c374bd02bf7f642a6c63aa5b39f5", which I don't particularly want in the URL.

Is there any easy way to just pass through form info, but not the security ID?

Avatar
(deleted)

Community Member, 473 Posts

26 August 2012 at 10:37pm

Also call $form->disableSecurityToken();

Avatar
JonShutt

Community Member, 244 Posts

26 August 2012 at 10:41pm

perfect - thanks!