I'm curious what the best method would be to implement next and previous submit buttons. This is a form on a physical inventory count. The form is simple, and at the bottom are two buttons. "<<" and ">>". When either is clicked, the form needs to be submitted, and then the next/previous record selected and the page refreshed (same action).
It'd be trivial to just go one direction, I can write text links that go either direction. But to do both the submit AND record traversal has me in a quandary. My choices seem to be either (a) Set a global $_SESSION variable and then use it in the controller to tell it which direction to go, (b) Set and use instance-varible (which I don't know how to do from inside a .tpl file, and don't know if t would stay there across a 'submit'.)
How would one of you approach the problem?
Thanks!
But to do both the submit AND record traversal has me in a quandary.
when your submit button has a name-attribute you will get the 'value' of the button in the $this->params
<input type="submit" name="submitAndGoToPrevious" value="Prev" />
in the controller...
$this->params['submitAndGoToPrevious']
use the flash to store states between requests.
Ahh, that's useful. I'll have to do some looking up on the flash feature. I know it's used to 'notify' too. Thanks again Kaste!
1 to 3 of 3