If you want to set new date on apex:inputText by referencing date from other element you can do it by using javascript.
You don't need to use apex date methods.
function functionreadOnly(Index,SecondElementId){
var idToDate;
var valueToDate;
if(Index != 0){
idToDate = SecondElementId.replace(Index + ":SecondElementId",Index-1 + ":FirstElementId");
valueToDate = document.getElementById(idToDate).value;
var Obj = document.getElementById(SecondElementId);
var dayAfter = new Date(valueToDate);
dayAfter.setDate(dayAfter.getDate()+1);
var finalEndDate = (dayAfter.getMonth() + 1) + '/' + dayAfter.getDate() + '/' + dayAfter.getFullYear() ;
Obj.value = finalEndDate;
//Making element read only
if(Obj.value.length != 0){
Obj.readOnly = true
}
}
}
No comments:
Post a Comment