Jump to content


Photo

"remember" Form


  • Please log in to reply
3 replies to this topic

#1 Ben_Waldman

Ben_Waldman
  • Members
  • 1 posts

Posted 06 March 2008 - 04:54 PM

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

#2 TCH-Dick

TCH-Dick

    General Manager

  • Admins
  • PipPipPipPip
  • 5,891 posts

Posted 06 March 2008 - 06:27 PM

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.

Dick DeVance
General Manager
TotalChoice Hosting, Inc
dick@totalchoicehosting.com


Posted Image


#3 Bob Crabb

Bob Crabb

    Immediate Family

  • Members
  • PipPipPipPip
  • 559 posts

Posted 06 March 2008 - 07:11 PM

You might try this:

<a href='java script:history.go(-1)' onmouseover='self.status=document.referrer;return true'>Return to Form</a>


#4 OJB

OJB

    Immediate Family

  • Members
  • PipPipPipPip
  • 364 posts

Posted 27 April 2008 - 09:22 AM

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 by OJB, 27 April 2008 - 09:24 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users