php - Using AJAX rather than sending a form -


this question has answer here:

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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -