pee2pee pee2pee - 3 months ago 28
reST (reStructuredText) Question

jQuery - Submit Form to RESTful URL

My mind has gone 100% blank on this so need some guidance please.

<form action="/" id="searchForm">
<input type="text" name="s" placeholder="Search...">
<input type="submit" value="Search">

I need that form so the page redirects to a URL such as{value of search}/
if I searched for

Do I even need jQuery for this?


Solution with jquery:

$('#searchForm').on('submit', function(event){
    $('[name=s]').prop('disabled', true)
    $(this).attr('action', '' +     $('[name=s]').val());