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.

Archive /

Our old forums are still available as a read-only archive.

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

Allowing only one form submission per session


Go to End


7 Posts   2658 Views

Avatar
Yellow7 Jon

Community Member, 39 Posts

6 November 2008 at 6:22am

Hey all, I am wondering if it is possible to limit the number of times a user can submit a form.

Say a user comes to the site, fills and submits the form, goes to another page, and back to the form page, i would like the "custom submit message" to be displayed instead of the form.

any way to do this ?

Avatar
Yellow7 Jon

Community Member, 39 Posts

7 November 2008 at 7:18am

anything :(

Avatar
Sean

Forum Moderator, 922 Posts

7 November 2008 at 10:47am

Hi there,

You could set a browser session variable after the user has submitted. Then, before you return your Form class, you could check the existance of the session variable.

If you'd like a bit of help with code, I could whip up a simple page type with a form and the session stuff I talked about.

Cheers,
Sean

Avatar
Yellow7 Jon

Community Member, 39 Posts

8 November 2008 at 6:30am

that would be great!

Avatar
deejayh

Community Member, 10 Posts

19 November 2008 at 6:10am

This would be great to see!

look forward to seeing it. I would also like to see some sort of Captcha added to the forms and also to the comments.

Regards,
Dave

Avatar
itlinux

Community Member, 40 Posts

20 November 2008 at 3:16pm

Wow that will be nice to check it out..

RM

Avatar
bebabeba

Community Member, 193 Posts

4 December 2008 at 3:14am

Hi!
I have your same problem but my code is wrong. canyou post some code?expecially about the poin where you set session in .php and .ss
Thanks!