MyBB Community Forums

Full Version: Easiest way to display error on page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been utilizing error($lang->plugin_error); for all of my plugin errors but I was wondering what would be the easiest way to display the error on the page instead of showing a new error page and making the user hit the back button? I've looked in other plugins and even looked at how MyBB does it but after 2 hours I'm getting no where. Sad

Basically the users are filling out a form and when they leave fields blank it shows them the error page but when they hit the back button on their browser it brings them back to an empty form, I would prefer to keep the fields filled out and just display the error above the form like the MyBB registration form does.

Thanks! Big Grin
I think you need to check the "datahandlers" hooks, e.g.
datahandler_event_validate
datahandler_event_insert
datahandler_event_update
You can use inline_error

Its not a plug 'n' play function like the error one but its what MyBB uses. Check out the member.php for how its used.