插入数据库后,JQUERY刷新.val()

时间:2012-07-27 18:14:19

标签: php jquery html refresh

如何在提交后返回时更改注册表单中的时间。

$("#leaveComment").find("input#time").val("<? echo time(); ?>");

插入数据库后(插入数据库配置并在文件资源/ lib / add-comment.php中工作)?

here is full code of needed jquery

here is PHP script for submit (add-comment.php file contents)

1 个答案:

答案 0 :(得分:5)

如果返回结果为json

$("#leaveComment").find("input#time").val(data.time);

或在echo内执行简单的add-comment.php

echo time();

然后:

$("#leaveComment").find("input#time").val(data); 
相关问题