Hi..
I have written an extra bulletin().... for my dialog
function bulletin()
{
var formsubmit= false;
var sysDate = new Date();
var startDateArray = new Array();
var startDate=document.getElementById("startdate").value;
var endDate=document.getElementById("enddate").value;
var hiddenValue = document.getElementById("hiddenValue").value;
if(startDate!=null){
startDateArray= startDate.split(" ");
}else{
alert("Please Select a Start Date");
formsubmit = false;
}
var monthCorrection = sysDate.getMonth();
monthCorrection =monthCorrection+1; // added since this method returns
0 to 11
if(monthCorrection<10)
monthCorrection= "0"+monthCorrection; // formatting month value
var dateCorrection = sysDate.getDate();
if(dateCorrection<10)
dateCorrection= "0"+dateCorrection;
var hourCorrection = sysDate.getHours();
if(hourCorrection<10)
hourCorrection= "0"+hourCorrection;
var minuteCorrection = sysDate.getMinutes();
if(minuteCorrection<10)
minuteCorrection= "0"+minuteCorrection;
var secondCorrection = sysDate.getSeconds();
if(secondCorrection<10)
secondCorrection= "0"+secondCorrection;
var currentDate=
sysDate.getFullYear()+"-"+monthCorrection+"-"+dateCorrection+"
"+hourCorrection+":"+minuteCorrection+":"+secondCorrection;
var currentDateTemp =
sysDate.getFullYear()+"-"+monthCorrection+"-"+dateCorrection;
if(hiddenValue == "false" ){
if(startDateArray[0]<currentDateTemp){
alert("Please Select a Valid Start Date : Start date cannot be Earlier
than Today");
document.getElementById("startdate").value = '';
formsubmit = false;
}
}
if(enddate != null){
if(endDate<startDate){
alert("Please Select a Valid End date : End date should
be later than Start Date");
document.getElementById("enddate").value = '';
formsubmit = false;
}
}
if(hiddenValue == "false" ){
if(startDateArray[0]>=currentDateTemp && endDate>=startDate)
formsubmit = true;
}else{
if(endDate>=startDate)
formsubmit = true;
}
if(formsubmit)
{
mgnlDialogFormSubmit()
}
Once I open the dialog and edit the contents are being saved(I checked the
JCR)but the dialog is not closing..
I have placed the js in my mgnl-reources folder in my module.I could not find
any fault ...Kindly help me on the issue!!!
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=a84c06e6-4076-4e2c-86dd-0da00f5ee013
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------