douxihui8270 2015-12-19 21:29
浏览 51

Joomla从表单更新数据库中的数据

I'm using joomla 3.4.6, and Form Maker component, I'm trying to modify the submission page.

I have a table that contains some data and a column with checkboxes. I also have a button "Save" When I click the button "Save", I want to save the value from the checkboxes in the database (0 for unchecked, 1 for checked)

I hope i'm providing code snippets that makes sense.

Save button

<div>
    <input type="hidden" name="hide_label_list" value="<?php  echo $lists['hide_label_list']; ?>" /> 
    <input type="button" style="vertical-align:middle; cursor:pointer" value="<?php echo JText::_( 'save' ); ?>" />
</div>

Check boxes from database

    <table class="submissions" width="100%">

        ...

        <tr class="<?php echo "row$k"; ?>">

        <td align="center"><?php echo $www+1+$pageNav->limitstart;?></td>

        <?php
        if(1==1) 
        {
            if($resolved == 0) 
                echo '<td align="center">
                        <input type="checkbox">Closed</input>
                      </td>';
            else
                echo '<td align="center"><input type="checkbox" checked>Closed</input></td>';
        }

        ...

    </table>

I checked https://docs.joomla.org/Inserting,_Updating_and_Removing_data_using_JDatabase and other google results, but because I'm new with php/joomla and working on an existent extension [Form Maker] it makes it hard to understand.

Here's the full php file in case it would make more sense

How can I update if checked and click save button?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog