开发者

automatically submit a file in jquery

how would I automatically submit a form to a php file in jquery. I have this form right now:

    <form action = 'add.php' method='get'>
<input type='hidden' name = 'title' value='$title'>
</form>

I ask this because I want to use this to pass a post variable to another php file (ie...going from A to B t开发者_StackOverflow中文版o C).


<form action = 'add.php' method='get' id="myform">
<input type='hidden' name = 'title' value='$title'>
</form>

<script language="javascript" type="text/javascript">
$(document).ready(function(){
  $('#myform').submit();
});
</script>


<form action = 'add.php' method='get' id="myform">
<input type='hidden' name = 'title' value='$title'>
</form>

<script language="javascript" type="text/javascript">
   document.getElementById("#myform").submit();
</script>


    <form action = 'add.php' method='get'>
<input type='hidden' name = 'title' value='$title'>
</form>
<script type="text/javascript">
$(document).ready(function(){
    $('form[action="add.php"][method="get"] input[type="hidden"][name="title"]').parent().submit();
});
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜