[.NET] TextBox 的 onblur 屬性

看板Visual_Basic作者 (無)時間18年前 (2007/05/24 14:09), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
是否 Asp.net 2.0 是不承認 onblur 屬性的 以下一段程式碼 <script type="text/javascript"> function addCommas(nStr) { nStr += ''; nStr = nStr.replace(/,/g,""); x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } </script> <input id="test" value="12345" onblur="this.value=addCommas(this.value);" /> <br /> <asp:TextBox ID="TextBox1" runat="server" onblur="this.value=addCommas(this.value);" /> 就會出現下面的警訊 驗證 (ASP.Net): 屬性 'onblur' 不是 'TextBox' 項目的有效屬性。 但實際跑起來,卻仍然有作用? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.63.21.246

05/24 21:45, , 1F
textbox在網頁上會變成input, onblur剛好有效
05/24 21:45, 1F
文章代碼(AID): #16LImo7a (Visual_Basic)
文章代碼(AID): #16LImo7a (Visual_Basic)