One, when there are more than one radio radio button in the HTML, set all radio button Name property to the same, you can implement only one effect at a time.
Second, limit the text box can only enter numbers, the code is as follows:
$(function(){ $(": Radio.dian"). Click (function(){ //remove all border styles after clicking Radio$ ("label"). Removeclass ("Bank_border")); if( This. checked) {//set Border style When radio is selected$( This). Parent (). Parent (). attr ("Class", "Bank_border"); } }); //prevent key input other than the number key$ ("#zf_money"). KeyDown (function(e) {digitinput ($ ( This), E); });});functionPrevent (e) {E.preventdefault? E.preventdefault (): E.returnvalue =false;}functiondigitinput (el, e) {varE = e | | window.event;//FF, Chrome IE get event object varc = E.charcode | | E.keycode;//FF, Chrome ie get keyboard code varval =El.val (); if(c = = + | | c = 190) {//110 (190)-Point on a small (primary) keyboard(Val.indexof (".") >= 0 | |!val.length) && prevent (e);//An existing decimal point or text box is empty and the input point is not allowed}Else { if((c! = 8 && c! = &&//8-backspace, 46-delete(C < PNS | | C > +) &&//Notoginseng (max) (max)-left (UP) (right ) Arrow(C < | | C > +) &&//48~57-0~9 on the main keyboard(C < | | C > 105))//96~105-0~9 of the keypad|| E.shiftkey | | !re.test ( This. Value)) {//Shift key, the corresponding code isPrevent (e);//prevent events from propagating to KeyPress } }}
View Code
Third, text box block Chinese input
<input style= "ime-mode:disabled" >
style= "ime-mode:disabled" means to turn off IME
Radio in HTML single-and text-box limits can only enter a number of solutions