This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

LemonStand Version 1 Has Been Discontinued

This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.

Handling errors

Errors could occur during the form processing. When an error occurs, LemonStand places its message to the internal variable. You can use the flash_message function to display error messages. Usually you place the flash_message function call above forms.

The following example demonstrates the Change Password page.

<h2>Change Password</h2>
<?= open_form() ?>
	<?= flash_message() ?>
	<label for="old_password">Old Password</label>
	<input id="old_password" type="password" name="old_password"/><br/>
	
	<label for="password">New Password</label>
	<input id="password" type="password" name="password"/><br/>
	
	<label for="password_confirm">Password Confirmation</label>
	<input id="password_confirm" type="password" name="password_confirm"/><br/>
	
	<input type="submit" name="change_password" value="Submit"/>
	<input type="hidden" name="redirect" value="/password_change_success"/>
</form>

If you process forms in AJAX mode, you do not need to use the flash_message function, because AJAX errors are displayed using the popup messages (JavaScript alert messages).

See also:

Next: Troubleshooting
Previous: Third-Party Integrations
Return to LemonStand Back-End