Ben_Waldman Posted March 6, 2008 Posted March 6, 2008 Hello all, Please bare with me as I try to explain my issue with very weak terminology. Well, I'm using Dreamweaver to create a database that uses PHP & MySQL. Currently, I'm working on a page that inserts user entered data from a form into my database. Upon clicking insert, MySQL will reject the data if a field is null, not in correct format, etc. So, when the user returns to the previous page to correct the error all the information previously entered is now gone. I'm not quite sure what to use so that the user entered information will be "remembered". I was thinking Javascript, but really couldn't find anything. Does Dreamweaver have something I can use? Possibly a cookie? I really have no idea and that is why I'm asking for help. If someone could even provide me with the correct terminology so I could do further research that would be very helpful. Thanks! Ben Quote
TCH-Dick Posted March 6, 2008 Posted March 6, 2008 What version of Dreamweaver are you using, CS3? If so you can use the Spry widgets for form validation. This will prevent the form from processing until all field requirements are met, eliminating any need to go back. Quote
Bob Crabb Posted March 7, 2008 Posted March 7, 2008 You might try this: ><a href='java script:history.go(-1)' onmouseover='self.status=document.referrer;return true'>Return to Form</a> Quote
OJB Posted April 27, 2008 Posted April 27, 2008 (edited) if you are posting to the same page then why not use the $_POST array to repopulate the fields i.e. ><form action="thispage.php" method="post"> <input type="text" name="whatever" value="<?php echo (isset($_POST['whatever']) ? $_POST['whatever'] : ''); ?>" /> <input type="submit" name="insert" value="Insert" /> </form> This will repopulate the 'whatever' field with the value that was entered before the user clicked 'Insert' and it will leave the fields blank when the form is loaded for the first time (i.e. when the post array is empty) edit: sorry if this is an old thread i replied then saw the date. Edited April 27, 2008 by OJB 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.