Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorsuthern
    • CommentTimeJan 3rd 2008
     

    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!

    • CommentAuthorKaste
    • CommentTimeJan 3rd 2008
     

    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.

    • CommentAuthorsuthern
    • CommentTimeJan 3rd 2008
     

    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!

Add your comments
    Username Password
  • Format comments as