Tagged: form action, front-end-form
- This topic has 1 reply, 1 voice, and was last updated 3 years, 7 months ago by
mcmaster.
-
AuthorPosts
-
-
June 24, 2018 at 5:41 pm #9080
mcmasterMemberI have a page that generates reports. It has a form asking for start date and number of weeks. When input is received, it prints the report and below the report shows the form again with the h2 heading “Generate Another Report.” See example at https://pik.redpup.net/reports/.
Because the reports can be very long, when I display a report I put a button at the top that says “generate another report” and links to “#generate” which is the ID for the h2 at the bottom of the page. Saves people from scrolling all the way.
But when the form is posted, it retains “#generate” as part of its action URL and so if the user posts another form, they are scrolled past the new report back to the generate form. This is the case whether method is post or get.
The piklist/parts/fields/form.php file starts with:
<form method="<?php echo strtolower($data['method']); ?>" action="<?php echo $data['filter'] ? home_url() . $data['action'] : null; ?>"So I tried adding an “Action” parameter to the parts/forms file:
/* Title: Choose Report Method: post Action: /reports/ Message: */But it has no effect. Is there a way to override the default action?
-
June 24, 2018 at 5:45 pm #9081
mcmasterMemberp.s. tried to upload a .zip file of the Piklist parts file but it was rejected. I thought zip files were allowed?
form-test.php_.zip: Sorry, this file type is not permitted for security reasons.
-
-
AuthorPosts
- You must be logged in to reply to this topic.