-6

For this:

<form action="/todo/save" method="post">
<input type="text" name="todo" />
<input type="submit" name="submit" value="Save" />
</form>

should redirect to /todo/save?todo=sometext&submit=Save -?

How can I do that?

  • 4
    Why is this tagged with `c`? – mrks May 08 '14 at 20:10
  • [Possible duplicate](http://stackoverflow.com/questions/14551194/how-are-parameters-sent-in-an-http-post-request) – pmg May 08 '14 at 20:16
  • I don't know much about this. I don't know how to build, pass, etc – user2992757 May 08 '14 at 20:22
  • Welcome to StackOverflow. It is not very clear at all what you're asking. Please describe what you're trying to do and where you're having the problem. Start with whether you are trying to do something client side (in the browser) or server side (in your web application code). Then explain what you've tried, what happened when you tried it, and (if applicable) why it isn't what you wanted. – jpmc26 May 09 '14 at 02:32

1 Answers1

2

You will need to change the method to GET and add a hidden field for submit:

<form action="/todo/save" method="get">
<input type="text" name="todo" />
<input type="hidden" name="submit" value="Save" />
<input type="submit" value="Save" />
</form>
mrks
  • 8,033
  • 1
  • 33
  • 62