我有超過5卡類型和每個卡作爲不同的驗證,當用戶更改卡類型時,reqpattern
將改變,我需要通過reqpattern
callonkeyup
函數中通過。 請告訴我如何在callonkeyup
函數中通過更改reqpattern
。如何通過輸入值使用javascript
callonkeyup(this,'AccountNumber',this.getAttribute('reqpattern'))
<input type="tel" reqpattern="^[0-9]+\$"
onblur="callonkeyup(this,'AccountNumber',this.getAttribute('reqpattern'));"
value="" id="AccountNumber"/>
爲什麼不粘貼你迄今爲止所做的工作,所以我們可以更好地幫助你...編輯:謝謝編輯@Jayesh – franklinexpress
用戶如何更改卡的類型?點擊一些元素或使用下拉等... – Arunkumar