php - Using AJAX rather than sending a form -
this question has answer here:
- jquery ajax submit form 14 answers
what equivalent of using ajax rather sending form in case
<form action="" method="post"> <div style="padding-left: 10 px:"></div> <input id ="datetime" style="display:none;" type="text" name="datetime" value="yyyy/mm/dd hh:mm:ss" size="5" > <a href="#" onclick="cal.select(document.forms[0].datetime,'anchor','mm/dd/yyyy'); return false;" title="cal.select(document.forms['example'].datetime,'anchor','mm/dd/yyyy'); return false;" name="anchor" id="anchor"><i class="icon-calendar"></i> </a> <input style="font-size: bold 8pt;" id = "done" type="submit" value="done" /> </form>
i want use ajax post new variables rather sending form.
it be
$("#done").click(function() { $.post("/",{"datetime": $("#datetime").val()}); return false; })
more $.post
: http://api.jquery.com/jquery.post/
Comments
Post a Comment