Saturday, 19 March 2022

Restrict number only in input box

 @section('script')

<script type="text/javascript"> 

         function restrictAlphabets(e) {

             var x = e.which || e.keycode;

             if ((x >= 48 && x <= 57))

                 return true;

             else

                 return false;

         }  

</script>

@endsection


onkeypress='return restrictAlphabets(event)'

No comments:

Post a Comment

Machine Learning - Potato Leaf Disease Prediction

Step 1: import numpy as np import pandas as pd import splitfolders import matplotlib.pyplot as plt import tensorflow as tf from tensorflow i...