2

this is my first entry in here, hope that I won't fail some rules.

I have an input field in HTML file that takes Port numbers from 0 to 65535 which is defined as min, max.

And I have a jQuery Input mask in JS file that is supposed to allow only inputs.

ACTUALLY, it works as it is supposed to in my local, but when I upload the code to the environment, there you can enter tons of minus(-) sign.

Well, I have compared the versions of jQuery and mask of my local and the server and I made them the same but it didn't help me to fix the problem.

JS:

$('#input_port').mask('00000', {
  placeholder: "Enter between 0-65535"
});

My expectation is that the code should allow entering ONLY numbers from 0 to 65535 but it allows you to enter more number after minus sign such as 65535------12345 but it should not.

Orcun
  • 21
  • 4
  • 2
    If it works locally with the same set of files look in the browsers error console, likely you will see an issue with a script path. – Alex K. May 28 '19 at 14:21
  • 2
    I can't work out what library you are using. The obvious one is throwing `mask is not a function` when I try it. Please provide an [mcve]. Use the live demo feature of the editor. – Quentin May 28 '19 at 14:23
  • 1. please provide details regarding which plugin you are using. 2 if it's working differently in local-vs-prd, then check what's different. Different browser? Local using `file:`? Use the browser's network tab to determine *exactly* which .js files are being included - you can see the file in the network tab then open in a new tab from there to view it. Maybe a different CDN giving a different file. Are you using any sort of min'd files? These *can* be different (for the same version) - try using un-min'd versions to get it to work first. Control-F5 both to ensure no cached files. – freedomn-m May 28 '19 at 14:36
  • @Quentin and freedom you guys are right, sorry.. Libraries in my local are listed below, https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.min.js I already added them to Prod locally. So, these are the same.. Browser is the same.. I have also tried Control-F5 but I did not try that un-min'd versions, thanks for the advice guys! I hope I will be giving feedback that I solved the issue thanks to you guys! – Orcun May 30 '19 at 06:57
  • @AlexK. Hi sir, as you mentioned I pressed F12 to see browsers error console and I received 4 formats of this: jquery.min.js:2 GET https://query.yahooapis.com/v1/public/yql?format=json&rnd=2019449&diagnostics=true&callback=jQuery34103836174067783187_1559199347917&q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text=%22New%20York%20City%22)%20and%20u=%22f%22&_=1559199347918 net::ERR_NAME_NOT_RESOLVED – Orcun May 30 '19 at 07:00

0 Answers0