How to transfer the results of submitting the form to the page I'm redirecting to?
For example, let's say I have the following logic:
Search Page -> validate
if errors - show Search Page again with errors <--- this part works
else - redirect to New Page(passing search params) <-- no params passed
My form processing looks something like this:
def process() = {
if (nameame== "Joe") {
S.error("Joe not allowed!")
}
val dateRegex="(\\d\\d/\\d\\d/\\d\\d\\d\\d|\\w*)";
if (!birthdate.matches(dateRegex)) {
S.error("birthdate", "Invalid date. Please enter date in the form dd/mm/yyyy.")
}
S.errors match {
case Nil =>S.notice("Name: " + name); S.redirectTo("search-results")
case _ =>S.redirectTo(S.uri)
}
}
As you can see, my search results do not get the name or date of birth parameters. How to pass parameters from a form when calling S.redirectTo ?
Let me know how I can somehow clarify the issue.
source
share