<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV></DIV>
<DIV>Hmm, to me that sounds like a good use of $_SESSION for storage (as in the cookie), with the advantage that it would persist across site visits, and it only belongs to that user.<BR> </DIV>
<P><FONT face="bookman old style, new york, times, serif" color=#ff007f size=4><EM><STRONG>Nancy</STRONG></EM></FONT></P>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: arial, helvetica, sans-serif"><BR>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: arial, helvetica, sans-serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Jeff Greenberg <jeff@ayendesigns.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> development@drupal.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tue, August 10, 2010 10:12:49 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [development] Temporary form data storage ... and avoiding validation<BR></FONT><BR>I'm using a module-generated form in a mode like a shopping cart, where the user can add data to it, go to other pages, and come back to it, and the data persists.<BR><BR>At first I wasn't submitting the data until it was time to complete the process, and so, to persist the data, I was using variable_get/set because without the form being submitted, nothing was being persisted in form_state. However, I've since switched to each of the buttons (return to other pages, update form, submit) causing a submit, with varying logic based on which button was
clicked. I discovered (duh!) that variable_set/get was a poor idea, because two users online at the same time end up would get each other's persisted data on the form.<BR><BR>So, two questions. Is form_state going to persist the user data for me between form loads, or is there a better method? And I've run into an interesting problem in that the portion of the form with required fields (name, etc) doesn't need to be filled in until the user wants to submit, but of course, that ends up throwing an error when the form is 'submitted' due to one of the other buttons being clicked. Is there a way to have those buttons cause a submit, but bypass validation?<BR></DIV></DIV></div></body></html>