2013-11-15 66 views

回答

0
<script language="javascript"> 
function replace() 
{ 
var number=document.getElementById('huh').value; 
var first=number.substr(0,number.indexOf('-')+1); 
var final=first+"0000000000"+number.substring(number.indexOf('-')+1); 
alert(final);//final contains ->PC-000000000012 
} 
</script> 

<asp:TextBox ID="huh" runat="server" onblur="replcae()"/> 
0

有一個名爲「onBlur」的事件( JavaScript事件)使用該事件,並添加JavaScript,將用戶輸入轉換,就像這樣:

<script language="javascript"> 
function test(){ 

} 
</script> 

<asp:TextBox ID="huh" runat="server" onblur="test()"/> 
相關問題