<!DOCTYPE html> <html> <body> <p>The test() method returns true if it finds a match, otherwise it returns false.</p> <p>Click the button to search a string for the character "e".</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var str = "-2:59"; var patt = /^-?\d*:[0-5][0-9]/; var res = patt.test(str); document.getElementById("demo").innerHTML = res; } </script> </body> </html> .test() method will return true if format is correct and false if format is wrong. var patt = /^-?\d*:[0-5][0-9]/; ^- Means optional of - \d* means any digit of decimal \d Means only one digit : Means compulsory to put : ^: Means optional to put : [0-5] means only can enter number 0-5 only. [0-9] means only can enter number 0-9 only. Above formula is to force user enter ...
You can just load the Partial view using this code: Load the Partial view to the DIV $( "#divdetail" ).load( ' @ Url.Action( "_Detail" , "GEMS_BCRpt" ) ' + "?ID=" + ID ); <script> $(function() { $("#btn").click(function() { var id = 10; var valoare = 'test'; var url = '/TestingImages/Index2?Id=' + id + '&valoareselectata=' + valoare; window.location.href = url; }); }) </script> <input id="btn" type="button" value=“submit"/> function changedet(ID) { $( "#divdetail" ).load( ' @ Url.Action( "_Detail" , "GEMS_BCRpt" ) ' + "?ID=" + ID ); }
Comments
Post a Comment