Re: [問題] js動態表格可以送出表單寫入資料庫嗎?

看板Ajax作者 (return false;)時間15年前 (2010/07/20 21:52), 編輯推噓0(009)
留言9則, 2人參與, 最新討論串2/3 (看更多)
※ 引述《iconograph (return false;)》之銘言: : 請問以javascript做出動態表格,可以提交表單後寫入資料庫嗎? : 我是用以下方式insert row,一直想不出提交表單後怎麼抓動態資料表的值 : 網頁是以asp與javascript撰寫的,是應該在javascript insert into嗎? : 或是有其它方式? : 可以請前輩們指點一下嗎? 謝謝 : // cell 1 - input text : var cell1 = row.insertCell(1); : var txtInp = document.createElement('input'); : txtInp.type = 'text'; : txtInp.name = INPUT_NAME_PREFIX + iteration; : // Don't refer to ids : //txtInp.id = INPUT_NAME_PREFIX + iteration; : txtInp.size = 40; : txtInp.value = ''; : cell1.appendChild(txtInp)X 其實我是參考http://www.mredkj.com/tutorials/tabledeleterow.html 裡面有個按鈕是submit,我不太清楚submit後的那個form如何去get動態表格的input text 然後get到值是用asp寫入資料庫嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.244.5.178 ※ 編輯: iconograph 來自: 60.244.5.178 (07/20 21:59)

07/20 21:59, , 1F
如果不是動態的話,你會作嗎?其實你說的這個問題跟動不動態
07/20 21:59, 1F

07/20 22:00, , 2F
沒有直接關係,對asp來講他就是接到一堆name-value的paramte
07/20 22:00, 2F

07/20 22:01, , 3F
你前面頁面要做的是確保name是正確的,後面asp則是要確保知
07/20 22:01, 3F

07/20 22:01, , 4F
道確實的name。
07/20 22:01, 4F

07/20 22:07, , 5F
Dear TonyQ:感謝你的回應,如果不是動態的table我知道
07/20 22:07, 5F

07/20 22:08, , 6F
那麼asp要如何去抓動態表格的text呢?
07/20 22:08, 6F

07/20 22:10, , 7F
我看到mredkj網頁的範例是用window.location.search
07/20 22:10, 7F

07/20 22:11, , 8F
但我的row可能會到一兩百行,也可以這麼做嗎?而且要逐行
07/20 22:11, 8F

07/20 22:11, , 9F
寫入單身..是否有什麼建議呢?
07/20 22:11, 9F
文章代碼(AID): #1CHQeHpn (Ajax)
文章代碼(AID): #1CHQeHpn (Ajax)