c# - Adding bracket when key in a number -
let's have textboxa. when application runs, textboxa shown , user can enter number. wanted format user input red color font , enclose brackets.
example: if user enter '5', format input (5), red color.
how achieve that?
function format(input) { var txtvalue = document.getelementbyid(input).value; document.getelementbyid(input).value = "("+txtvalue+ ")"; document.getelementbyid(input).style="color:red;"; } use above javascript function , call in textbox onchange="format(this);"
Comments
Post a Comment