gpt4 book ai didi

php - 我如何在单击按钮时执行两个操作

转载 作者:搜寻专家 更新时间:2023-10-31 20:41:04 25 4
gpt4 key购买 nike

我有一个页面,其中包含一些输入字段和一个表格,三个按钮分别为播放、暂停、停止。我只想在按下播放按钮时刷新表格部分。我希望播放按钮执行两个操作,一个是运行更新查询并仅重新加载页面。当我单击暂停按钮时,我想停止重新加载表。当我按下停止按钮时,我希望它运行一个 udate 查询。我正在使用 codeigniter,MVC 架构。这是我尝试过的和我的查看页面。

<meta http-equiv="refresh" content="300">   
<input type="text" size="7" id="IC" name="IC" value="<?php echo set_value('IC',$IC); ?>" />
<input type="text" size="7" id="ID" name="ID" value="<?php echo set_value('ID',$ID); ?>" />
<button type="button" style="width:100px;">PLAY</button>
<button type="button" style="width:100px;">PAUSE</button>
<button type="button" style="width:100px;">STOP</button>
<table>
<tr>
<th> blah </th>
<th> blah </th>
<th> blah </th>
</tr>
//do some code
</table>

最佳答案

您可以在单击按钮时同时调用两个 js 函数。就像一种方式..

function jsfun1()
{
//do the action here
}

function jsfun2()
{
//do the action here
}

call both on onclick

<button type="button" style="width:100px;" onclick="jsfun1(),jsfun2()">play</button>

关于php - 我如何在单击按钮时执行两个操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21599682/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com