Skip to content

Instantly share code, notes, and snippets.

@alivedise
Created February 3, 2013 14:55
Show Gist options
  • Select an option

  • Save alivedise/4702089 to your computer and use it in GitHub Desktop.

Select an option

Save alivedise/4702089 to your computer and use it in GitHub Desktop.
Bug: 統聯客運訂票系統選擇座位頁面問題
Step to reproduce:
1. 使用訂票系統到選票數及座位頁面
Expected:
1. 可正常按確定送出
Actual:
1. 確定送出無用
Root cause:
1.Console
Uncaught TypeError: Cannot read property "value" of null seatsign.php:544
seatsign.php裡面有個隱藏的INPUT叫input type="hidden" name="tktnum" value="0"
但是在JAVASCRIPT存取的時候是用document.getElementById("tktnum").value
這是錯的 該ELEMENT並沒有id屬性
2. function addtktnum未定義
理論上每個座位check input在click事件發生後都會去更改隱藏input tktnum的數值, 但是line#546的addtktnum被註解起來了
因此tktnum的數值永遠是字串"0", 在表單送出後比較時就會產生錯誤
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment