-1

How can I add may parameters when submitting my form.

<form name="frmSearch" action="list-of-all-jobs/by-date" method="POST">
<input type="text" name="kewords" id="keywords">
</form>

I already Rewrite my url to list-of-all-jobs/by-date. I just want to add may keywords parameter in the action when submitting so that the link of the page must be site.com/list-of-all-jobs/by-date/keywords.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
  • 1
    Possible duplicate of [Clean URLs for search query?](http://stackoverflow.com/questions/5464481/clean-urls-for-search-query) – chris85 Dec 10 '15 at 03:00

2 Answers2

0

Post action - Appends form-data inside the body of the HTTP request. The request parameters are added in the URL seperated by '&'. In your case it will be list-of-all-jobs/by-date?keywords=keys. If you want to add many keys either provide many input fields or append the keys using using commas like

list-of-all-jobs/by-date?keywords=key1,key2`

And do the processing in the server by splitting the query string parameter by commas.

Deepak M
  • 223
  • 4
  • 14
-1

You can change the form action using jquery.

HTMl is:

<form name="frmSearch" action="list-of-all-jobs/by-date" method="POST">
    <input type="text" name="kewords" id="keywords"/>
    <input type="submit" id="submitaction"/>
</form>

Jquery is:

$('#submitaction').click(function(e)
{
    $("form").attr('action', 'list-of-all-jobs/by-date?keywords='+$('#keywords').val());
});
Ishpreet
  • 659
  • 5
  • 19