javascript - how to make form action change hash and not reload page? -
i have website has dynamic info , based on info after '#' when alter in url website not reload, when alter in form reloads webpage...
how can create chagnes value after # without reloading page?
<div id="but1"> <form action="http://website.com/#800" enctype="multipart/form-data" method="post"> <input type="submit" value="submit"> </form> </div> can have phone call javascript function on form action? how that?
yes. can utilize onsubmit attribute in html phone call function list this:
<form onsubmit="myfunction(); homecoming false;"> or can bind on submit function using jquery this:
$('form').submit(myfunction); if looking process info on server, can utilize jquery ajax method send info page asynchronously.
javascript jquery html forms hash
No comments:
Post a Comment