Welcome Guest, Not a member yet? Register   Sign In
Form validation redirect to same page
#11

[eluser]sqwk[/eluser]
Can you pass the formdata with the redirect function?
#12

[eluser]Cro_Crx[/eluser]
[quote author="squawk" date="1259871222"]Can you pass the formdata with the redirect function?[/quote]

No, you can't. If you have to do that then you should probably think about your application design some more. There shouldn't' be any situations where you would need to process data across multiple controllers.

If you give us a general idea of what you want to do i'm sure someone can point you in the right direction.

All you probably need to do is process the form data and then redirect afterwards, this would solve the problem of redirecting with data.
#13

[eluser]sqwk[/eluser]
I am searching a database. There is a basic search form on the homepage (1st controller). It the data validates, the user should be directed to results page (2nd controller), if it doesn't the errors are shown on the homepage (1st controller).

On the results page there is a more detailed search form, which submits to itself. It the form data doesn't validate the result set from the last search is shown.

At the moment I am tackling this by getting the form fields, encoding them into a url segment, redirecting to the second controller, where they are decoded and the results are displayed. The search form on this second page simply redirects to itself. Depending on whether that data validates, the page loads again with errors or the user is redirected to a new url (result set).

It works fine, yet it seems incredibly messy. It does have the advantage that searches are bookmarkable, but that is about it…




Theme © iAndrew 2016 - Forum software by © MyBB