作者iconograph (return false;)
站內Ajax
標題Re: [問題] js動態表格可以送出表單寫入資料庫嗎?
時間Tue Jul 20 21:52:15 2010
※ 引述《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)
1F:→ TonyQ:如果不是動態的話,你會作嗎?其實你說的這個問題跟動不動態 07/20 21:59
2F:→ TonyQ:沒有直接關係,對asp來講他就是接到一堆name-value的paramte 07/20 22:00
3F:→ TonyQ:你前面頁面要做的是確保name是正確的,後面asp則是要確保知 07/20 22:01
4F:→ TonyQ:道確實的name。 07/20 22:01
5F:→ iconograph:Dear TonyQ:感謝你的回應,如果不是動態的table我知道 07/20 22:07
6F:→ iconograph:那麼asp要如何去抓動態表格的text呢? 07/20 22:08
7F:→ iconograph:我看到mredkj網頁的範例是用window.location.search 07/20 22:10
8F:→ iconograph:但我的row可能會到一兩百行,也可以這麼做嗎?而且要逐行 07/20 22:11
9F:→ iconograph:寫入單身..是否有什麼建議呢? 07/20 22:11