How to redirect to another page using Scala Template

senjata4

New Member
I have two html pages: \[code\]/algorithrms\[/code\] and \[code\]/algorithms/add\[/code\] written in scala template. The route file contains following lines:\[code\]GET /algorithms controllers.Application.algorithms()GET /algorithms/add controllers.Application.newAlgorithmForm()\[/code\]I want to add a button in the page \[code\]/algorithms\[/code\] and when I click that button, it simply redirects to the second page \[code\]/algorithms/add\[/code\]. I know how to do this in JavaScript. I just want to call an action from the button click and then let the action redirects me to the landing page.So I added the following code in the first page's html template:\[code\] @form(action=routes.Application.newAlgorithmForm()){ <input type="submit" value="http://stackoverflow.com/questions/15669656/Add"> }\[/code\]It worked, but the landing url is: \[code\]http://localhost:9000/algorithms/add?\[/code\]I don't want that question mark. I want to know 1) what I did wrong to cause the question mark to generate and 2) how to remove it?
 
Back
Top