Viewing 1 reply thread
  • Author
    Posts
    • #9080
      mcmaster
      Member

      I 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?

    • #9081
      mcmaster
      Member

      p.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.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.