We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Module development help

Development and Programming

commonagency's avatar
commonagency
9 posts
15 years ago
commonagency's avatar commonagency

I am working a module for my website at the moment, in which if a user is logged in they can rate there energy levels out of 10 and can monitor there results using a graph, I have the module semi working in that I can get the form to submit, however the post does not populate on the first submit, I have to go back to form and submit again before my post is filled with all the data. I don’t why this would happen, as I assumed that submitting a form would populate the post as the method is post, I have attached the module files for your viewing. I have also included the view files in the same folder. The second issue that once submitted I get forwarded onto a blank white screen, and not back to the page that user submitted the form from.

NOTE: This script works fine in Chrome, the errors seems to be in Firefox!? Not seen cross browser issues with POST before

       
the3mus1can's avatar
the3mus1can
426 posts
15 years ago
the3mus1can's avatar the3mus1can

This could potentially be a redirect issue because of a missing trailing slash in the action url. fetch_current_uri() returns the current uri with the trailing slash removed.

function fetch_current_uri()
{ 
    return rtrim($this->remove_double_slashes($this->fetch_site_index(1).$this->EE->uri->uri_string), '/');
}

Try this in your mod file:

$this->form_action = ( ! $this->EE->TMPL->fetch_param('form_action')) 
                                         ? $this->EE->functions->fetch_current_uri() . '/' 
                                         : $this->EE->functions->create_url($this->EE->TMPL->fetch_param('form_action'), TRUE);
       
commonagency's avatar
commonagency
9 posts
15 years ago
commonagency's avatar commonagency

Thanks for your reply the3mus1can I have tried your suggestion and I get the same outcome, select the ratings using the radio buttons in the form, click submit, form submits and user sees a white screen at the URL /index.php/ratings. My understanding might be off here but should EE serve the index page of the ratings.group folder?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.