繁体   English   中英

发布对php函数的调用

[英]post call to a php function

好的,即时通讯正在使用onmousedown调用我的javascript函数,然后该函数根据我发送的内容将php变量设置为表单。 我如何将php脚本返回的内容返回到原始脚本,以便可以使用下拉列表显示

function toggleInteractContainers(x) 
{
  if ($('#'+x).is(":hidden")) {
   $('#'+x).slideDown(200);
  } else {
   $('#'+x).hide();
  }
  $('.interactContainers').hide();
}

的HTML是

<div class="interactContainers" id="edit_venue">       
    <?php echo $display_edit_form; ?>  
</div>

脚本是

if ($_POST["request"] == "edit_now")
 {

  $display_edit_form =' 
   <form action="" method="post" name="venue_edit">
             <table width="90%" border="1" cellspacing="5" cellpadding="5">
                  <tr>
                    <td width="20px"><?php echo $id ?></td>
                    <td align="right">Venue Name :</td>
                    <td align="left"><input name="venue" type="text"></td>
                  </tr>
                </table>
   <input name="submit" type="submit" value="submit">
            </form>';
  return $display_edit_form;  
 }

我只需要一个javascript来调用该帖子并获取$ display_edit_form回到然后将其设置为php Var

我希望我能给您足够的信息以给我答复

如果我理解正确,则需要进行ajax调用,然后将HTMLresponse附加到您的interactContainer div中(不使用php echo out)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM