Welcome Guest, Not a member yet? Register   Sign In
Use 'return confirm' before running a DBquery + print table
#1

[eluser]Hana[/eluser]
Hello,
In my view, I display results from a DB query.
I can select (check) some objects to disable them.

What I need: I would like to print when the user clicks on "Disable" a "pop-up", which says:
"object 1
object 2
object 3
... will be disabled. Are you sure?"
YES - NO

I found this, onclick="return confirm('disable[]')" but impossible to put the value of disable[]

Any ideas? :-)
Thank!!!

Code:
<?php echo form_open('GP/ObUsersAdm/disable',$attributs); ?>
           if ($Users)
                {
   foreach($Users as $index=>$item)
                        {
                            echo "  <tr>            
                                        <td>&lt;input class='select' type='checkbox' name='disable[]' value='".$item[0]."' id='$item[0]'&gt;&lt;/td>
                                        <td>".$item[2]."</td>                                    
                                    </tr>";                    
                         }
                }
                else
                {
                    echo "No result.";
                }
?&gt;
</tbody>
        
</table>
        &lt;input class="validator" type="submit" value="Disable selected" name="submit" /&gt;

(In the controller I obtain the value with $_POST("disable")




Theme © iAndrew 2016 - Forum software by © MyBB