How could I perform two action on a button click

I have a page with some input fields and a table and three button play , pause , stop respectively.I want to refresh the table part only when iI press the play button. I want the play button to perform two action one is to run a update query and reload the page only. I when I click on the pause button I want to stop the reloading of the table .And when I press the stop button I want it to run a udate query . I am using codeigniter, MVC architecture. This what I tried and my view page.

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

Answers


You can call two js functions at a time on click of button. like a way..

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>

Do it with javascript.

Just make 2 functions and use onclick-action in Button tag. onclick="playButton0(),playButton1()"


You can use jQuery framework to do all this things.

blind .click function for every button and do stuff with $.ajax function

With ajax function you can post values to controller you want and perform a query or something you want.

more info:

http://api.jquery.com/click/

http://api.jquery.com/jquery.ajax/


Need Your Help

How to align any number of child elements uniformly across the entire width within the layout?

android android-layout

I have a list of elements and a layout at the bottom of the screen. This layout contains some ImageButtons. It looks in such a way:

Asp.net LoginStatus - 'log out' shows but not logged in yet

asp.net

Why does my loginStatus show 'log out' even though I've not actually logged in yet?