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

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -