381
Views
6
Comments
Solved
manual date entry 
Question

hi all, good day.

how do i disable manual entry of date of birth filed.

user has to choose via date picker only 

how do i achieve this.

the  bug  raised by my testing department

can any one help me.

i tried this i apply enable =false  the filed is become disable even date picker is not opening if click on text filed .   

Rank: #347
Solution

Hi Rajesh,

Please mark my answer as a solution.

Thanks

Rank: #5958

Hi Pravi,


Is any solution available for reactive web for avoid manual date entry

Rank: #492

Hello Rajesh,

Please check attached image to get it done.

Add Calendar widget with Icon beside it and set Calendar input trigger with that Icon and set input property


onkeypress: "return false;"


Rank: #21161

Amol Tupe wrote:

Hello Rajesh,

Please check attached image to get it done.

Add Calendar widget with Icon beside it and set Calendar input trigger with that Icon and set input property


onkeypress: "return false;"



Thanks for reply,

working perfect!!


Rank: #347

Hi Rajesh,

Use the below javascript to force user to select date from the Date Picker only.


/*JS For Validating Date Input*/
$(document).ready(function(){
  $('.DateInputValid').on("cut copy paste",function(e) {
    e.preventDefault();
  });
});
$(document).on("cut copy paste",".DateInputValid",function(e) {
    e.preventDefault();
  });




function nokeypress(evt,InpId)
{
var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode !=13)
    {
       // $("#ValidationMessage_"+InpId.id).html("Please select date from calendar").show().fadeOut("slow"); 
    return false;
    
    }
    return true;
}

After adding this javascript to module, call this function "return nokeypress(event,"+txtCreatedTo.Id+");"

on "onkeypress" event. Also apply the style class "DateInputValid" to prevent user from cut, copy, paste.


Forum.png

Rank: #21161

Pravi Gupta wrote:

Hi Rajesh,

Use the below javascript to force user to select date from the Date Picker only.


/*JS For Validating Date Input*/
$(document).ready(function(){
  $('.DateInputValid').on("cut copy paste",function(e) {
    e.preventDefault();
  });
});
$(document).on("cut copy paste",".DateInputValid",function(e) {
    e.preventDefault();
  });




function nokeypress(evt,InpId)
{
var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode !=13)
    {
       // $("#ValidationMessage_"+InpId.id).html("Please select date from calendar").show().fadeOut("slow"); 
    return false;
    
    }
    return true;
}

After adding this javascript to module, call this function "return nokeypress(event,"+txtCreatedTo.Id+");"

on "onkeypress" event. Also apply the style class "DateInputValid" to prevent user from cut, copy, paste.


Thank you.


Rank: #347
Solution

Hi Rajesh,

Please mark my answer as a solution.

Thanks

Rank: #5958

Hi Pravi,


Is any solution available for reactive web for avoid manual date entry