第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

將數(shù)據(jù)從數(shù)據(jù)表添加到 Laravel 中的模式

將數(shù)據(jù)從數(shù)據(jù)表添加到 Laravel 中的模式

PHP
尚方寶劍之說 2023-10-01 16:10:22
我有以下代碼,我想知道如何將數(shù)據(jù)從表傳遞到模態(tài)這是我在 edit.blade.php 中的代碼。模式確實(shí)有效,但我不知道如何使數(shù)據(jù)顯示在模式中,我會(huì)自己 POST 到數(shù)據(jù)庫,但我只想知道如何顯示該數(shù)據(jù),以便我可以編輯它。我想在模態(tài)中顯示的數(shù)據(jù)是 ID、姓名和電子郵件。這是我在 editar.blade.php 中的代碼<script src="{{ url('/js/vendor/jquery-1.12.4.min.js') }} "></script><script src="{{ url('/js/bootstrap.min.js') }} "></script><link rel="stylesheet" href="{{ url('/css/bootstrap.min.css') }} "><script src="{{ url('/js/jquery.dataTables.min.js') }} "></script><div class="container">  <h2>Editar estudiante</h2><div class="container">               <h2>Laravel DataTables Tutorial Example</h2>               <table id="user_table" class="table table-bordered table-striped">     <thead>      <tr>                <th width="35%" id="name">Name</th>                <th width="35%" id="email">Email</th>                <th width="30%">Action</th>      </tr>     </thead>    </table></div><div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true">  <div class="modal-dialog modal-lg" role="document">    <div class="modal-content">      <div class="modal-header">        <h5 class="modal-title" id="edit-modal-label">Edit Data</h5>        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>        </button>      </div>      <div class="modal-body" id="attachment-body-content">        <form id="edit-form" class="form-horizontal" method="POST">          <div class="card text-white bg-dark mb-0">            <div class="card-header">              <h2 class="m-0">Edit</h2>            </div>
查看完整描述

1 回答

?
吃雞游戲

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超7個(gè)贊

你能試試這個(gè)嗎?

   $('#modal-input-name').val($tr.find('td.user-name').text());

   $('#modal-input-email').val($tr.find('td.user-email').text());

另外,我建議您使用 acss class來定位點(diǎn)擊事件,就像Id通常用于唯一標(biāo)識(shí)符一樣,并且按照您的方式,您將擁有許多具有相同內(nèi)容的表行Id,這違背了最初的想法。


查看完整回答
反對 回復(fù) 2023-10-01
  • 1 回答
  • 0 關(guān)注
  • 98 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號