<input type="number" pattern="[0-9]*" placeholder="" autocomplete="off">
what is the cause of this problem? How to solve it?
question picture:
<input type="number" pattern="[0-9]*" placeholder="" autocomplete="off">
what is the cause of this problem? How to solve it?
question picture:
enter a positive integer greater than 0
the code is as follows:
< input onkeyup= "if (this.value.length==1) {this.value=this.value.replace (/ < sup id=" fnref-1 "> 1 < / sup > / g else')} else {this.value=this.value.replace (/ Dramp g else')}" onafterpaste= "if (this.value.length==1) {this.value=this.value.replace (/ < sup id=" fnref-1 "> 1 < / sup > / g, '')} else {this.value=this.value.replace (/ DCMG recording')} ">
1, the text box can only enter numeric codes (nor can decimal points)
the code is as follows:
< input onkeyup= "this.value=this.value.replace (/ DAccord gpencil')" onafterpaste= "this.value=this.value.replace (/ DAccord gpencil')" >
2, you can only enter numbers and can enter decimal points.
the code is as follows:
< input onkeyup= "if (isNaN (value)) execCommand ('undo')" onafterpaste= "if (isNaN (value)) execCommand (' undo') >
< input name=txt1 onchange=" if (/ D/.test (this.value)) {alert ('only numbers can be entered'); this.value='';} ">
3, number and decimal point method two
the code is as follows:
< input type=text tasking value = "" onkeypress= "if (! this.value.match (/ ^ [+ -]? d ?. D ? $/)) this.value=this.t_value;else this.t_value=this.value; If (this.value.match (/ ^: [\ +\ -]?\ d + (?:\.\ d+)?)) this.o_value=this.value "onkeyup=" if (! this.value.match (/ ^ [+ -]? d ?. D ? $/)) this.value=this.t_value;else this.t_value=this.value; If (this.value.match (/ ^: [\ +\ -]?\ d + (?:\.\ d +)?)) this.o_value=this.value "onblur=" if (! this.value.match (/ ^ (: [+ -]? d +)? | .d *?)? $/)) this.value=this.o_value;else {if (/ ^\.\ dcards /)) this.value=0+this.value; If (this.value.match (/ ^. $/)) this.value=0;this.o_value=this.value} ">
you can only write one function to match input values to form a response
delete if it does not meet your input requirements to achieve the effect of not allowing other characters to be entered
because the number type allows you to enter +-/ *.
these
Previous: Dealing with list
Next: How to use css to make a div pop-up box highly adaptive to the content
is not to analyze user browsers, but to evoke Wechat app in Weibo app and open a link with Wechat app; WeChat Work can have this function, whether Weibo has a similar configuration. ...
use Wechat public platform JSSDK to develop Wechat sharing function! Every time I use the company s public platform account, I report a signature error! There is nothing wrong with the account of the public platform developed by myself! I would like to...
there is a div element in the table cell: https: jsfiddle.net xiaoxiya. what is the problem? Is that bug? ...
I use vue-cli to build the mobile project, and then use iframe to embed Youku s video code as follows <iframe width=100% height=350 src="http: player.youku.com embed XMzI1NTY2Nzc0MA==" frameborder=0 allowfullscreen>< iframe> th...
We are Mini Program s project. To get the code logged in by Wechat, request the backend api to get the sessionkey. But if it is a concurrent request, if it happens to expire at this time, and several requests go to get the sessionkey at the same time, t...
problem: the IOS system entered the page for the first time and added if (navigator.geolocation) {}, but did not execute navigator.geolocation.getCurrentPosition (this.showPosition.bind (this), this.showError.bind (this), options); did not enter showPo...
I found a js code from the Internet to calculate the time difference effect is that we have been together xx days xx xx minutes xx seconds problem is that this time will not change only enter the web page after refreshing to keep the same value so I...
for example, I set currentTime=20S, to start playing the video at 15s, and the address of my video is http: www.amdcu.net admin da.....
< H1 > problem description < H1 > while writing transition animation, I inadvertently found that sometimes the page would jam, and the Chrome memory of the viewing task manager suddenly soared. After various exclusions, I found that transform:skew (9...
The page does the function of the page before the jump after the completion of the event, using the method of adding returnUrl on Url, but when testing on the mobile side, a pop-up window will appear to show the path of the page to be redirected before r...
how to jump to a page to display the user s information page immediately after following Wechat s public platform? At the same time, it also displays the information of the user UnionID! I would like to ask all the masters! ...
how to use js code in html to display hidden div in sequence it is better to have special effects ...
use location.hash = "- sharpfooter " to navigate to the DOM node on the page where id is footer, then scroll to the click location and click again, it will not jump to the-sharpfooter position again, only the first click is valid ...
dynamic effects that are often overlooked are so important to user experience design Animation effect is an unavoidable link in user experience design, while in mobile interaction, dynamic effect exists as a transition lubricant and an important lin...
what if Android browsers always have the highest video tag level? Video is always at the top level, cover up some other div ...
,input ,input !!! edgevue elementui input(,),, input edge localhost:8080 ...
for parsing, a.b and a [b] are both written to get object properties. But the difference is that the b of a [b] can only be a string. how does the following code parse, and why is the output value 345345333? var a = {}; var b = {key: b }; var c ...
there is a mobile project currently in testing, using vue (2.2.2) + mint-ui for development, and I don t know how to handle compatibility. What method should be used to determine whether the current environment is working properly? I just looked at t...
https: www.mi.com aispeaker-. after scrolling to the location of the broadcast map, I found that the scroll bar will also continue to scroll, feeling that there is something fishy about it. does anyone know the implementation details in this? ...
as in the routing configuration above, there is no server, and it starts locally. In the case of mode: hash , the routed access will enter the corresponding component. In the case of mode: history , however, no matter which route is accessed, it ...