Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form class documentation outdated? #8788

Open
christohill opened this issue Feb 7, 2019 · 1 comment
Open

Form class documentation outdated? #8788

christohill opened this issue Feb 7, 2019 · 1 comment

Comments

@christohill
Copy link

Affected Version

Tested in 4.3, but could affect older versions.

Description

The documentation for the Form class (https://api.silverstripe.org/4/SilverStripe/Forms/Form.html) says:

The form class extends {@link RequestHandler}, which means it can be accessed directly through a URL. This can be handy for refreshing a form by ajax, or even just displaying a single form field. You can find out the base URL for your form by looking at the <form action="..."> value. For example, the edit form in the CMS would be located at "admin/EditForm". This URL will render the form without its surrounding template when called through GET instead of POST.

By appending to this URL, you can render individual form elements through the {@link FormField->FieldHolder()} method. For example, the "URLSegment" field in a standard CMS form would be accessible through "admin/EditForm/field/URLSegment/FieldHolder".

After testing on multiple forms, including the admin/EditForm example, this doesn't actually work and returns This form requires a POST submission instead of the rendered HTML of the form.

Steps to Reproduce

Append the form name to the end of the URL of the page the form is located on. ie:

mysite/admin/EditForm
mysite/contact/ContactForm

Is there a proper way to do this? Or is this just outdated documentation?

@social-butterfly
Copy link

Is there a solution by now? Still have the same problem in SS 4.12 - trying to load a form with AJAX (or direct URL input) and still get this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants