简体   繁体   中英

post call to a php function

ok what im doing is using onmousedown to call my javascript function this function then sets a php variable to a form depending on what i send. how do i get what is returned from php script back to the the orginal script so it can be displayed in an a drop down using

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

the html is

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

the script is

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;  
 }

i just need a javascript to call the post and get the $display_edit_form back then set it to a php Var

I hope i gave you enough info to give me an answer

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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