javascript - HTML form submit in proper way -
i have search field in every section of webpage . (www.webpage.com,www.webpage.com/new) .
when submit form in /new sth www.webpage.com/new?search=example want www.webpage.com/?search=example wherever submit form .
html
<form id="search_form"> <input id="search_field" type="search" name='search'> </form>
js
$('#search_form').submit();
specify base url action
attribute.
<form action="/" ...>
Comments
Post a Comment