weixin_33696822 2017-03-09 10:55 采纳率: 0%
浏览 5

多输入AJAX接线柱

Hi there,

I'm working on a project, but I'm a bit stuck. It's a logical question. I'll explain: We have a list of articles - Table: articles - saved in the database. However, we have collapse-able elements (let's call them accordeons now), which are based on the enabled languages (Table: languages). Now I'm tasked with saving every input for every "Accordeon" in the database, where content for the accordeons is stored in "article_language".

The accordeon (It's contained in a WHILE-loop)

 <div class="accord">
        <div class="accordeon-head" data-id="<?php echo $language['shortname']; ?>"><?php echo $language['fullname']; ?><div class="accordeon-right"><i class='fa fa-chevron-down'></i></div></div>
        <div class="accordeon-body" data-id="<?php echo $language['shortname']; ?>">

            <div class="form-container bottom">

                    <div class="form-float full-width">
                        <label class="input-label" for="agg_e_txt"><?php echo $lang['ARTS_INPL_TXT']; ?></label>
                        <textarea type="text" id="agg_e_txt" name="agg_e_txt"><?php echo $text['article_text']; ?></textarea>
                    </div>

                    <div class="clear toplabel"></div>

                    <div class="form-float middle">
                        <label class="input-label" for="agg_e_rec"><?php echo $lang['ARTS_INPL_RECUSE']; ?></label>
                        <textarea type="text" id="agg_e_rec" name="agg_e_rec"><?php echo $text['article_recuse']; ?></textarea>
                    </div>

                     <div class="space"></div>

                    <div class="form-float middle" style="float:right;">
                        <label class="input-label" for="agg_e_spec"><?php echo $lang['ARTS_INPL_SPEC']; ?></label>
                        <textarea type="text" id="agg_e_spec" name="agg_e_spec"><?php echo $text['article_spec']; ?></textarea>
                    </div>

            </div>

            <div class="clear"></div>

        </div>

    </div>

I'd like to do this with an AJAX post. What is the best way to store everything for an accordeon in the article_language table with the correct language prefix?

My thoughts were a WHILE loop in the AJAX call, or a each in the jQuery. But, I'm not sure.

What is the best way to achieve this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 C#读写EXCEL文件,不同编译
    • ¥15 如何提取csv文件中需要的列,将其整合为一篇完整文档,并进行jieba分词(语言-python)
    • ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
    • ¥15 扩散模型sd.webui使用时报错“Nonetype”
    • ¥15 stm32流水灯+呼吸灯+外部中断按键
    • ¥15 将二维数组,按照假设的规定,如0/1/0 == "4",把对应列位置写成一个字符并打印输出该字符
    • ¥15 NX MCD仿真与博途通讯不了啥情况
    • ¥15 win11家庭中文版安装docker遇到Hyper-V启用失败解决办法整理
    • ¥15 gradio的web端页面格式不对的问题
    • ¥15 求大家看看Nonce如何配置