Veramys Posted June 16, 2014 Posted June 16, 2014 Okay so I have no experience with Ajax whatsoever, how would I stop a page from bringing up the "Confirm Form Resubmission"? Like say I have someone training, and they're trying to do it as fast as possible to keep from wasting supplies. How would I get it to repost the data but not have to hit ok while doing it? Any help would be much appreciated. Thanks. Quote
Veramys Posted June 16, 2014 Author Posted June 16, 2014 If google was my friend I wouldn't be asking here. Quote
Script47 Posted June 16, 2014 Posted June 16, 2014 If google was my friend I wouldn't be asking here. True. How about these? Link Link Link Link JSFiddle Quote
wrux Posted June 16, 2014 Posted June 16, 2014 You do not need to use AJAX. A simple method is to use session based "flash messages". Just a simple example: In your file that handles the form: <?php // handle form stuff here $_SESSION['FLASH'][] = array('type'=>'success', 'message'=>'Your success message'); ?> & then in your template somewhere you could use this: <?php if(count($_SESSION['FLASH'])) { foreach($_SESSION['FLASH'] as $m) { echo '<div class="message-'. $m['type'] .'">'. $m['message'] .'</div>'; unset($m); } } ?> I didn't test that code and theres probably a ton of logic errors but it was an example. If you are going to use something like that website wide however i'd suggest you write an API for it. Nothing fancy really. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.