Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/05/2010, 09:25
carlorodri
 
Fecha de Ingreso: mayo-2010
Mensajes: 7
Antigüedad: 14 años
Puntos: 0
Respuesta: Problema calendario submit

Esta es la funcion principal del calendario, luego hay muchas mas pero son 900 lineas de codigo...


Código PHP:
Ver original
  1. function Epoch(name,mode,targetelement,multiselect)
  2. {
  3.   this.state = 0;
  4.   this.name = name;
  5.   this.curDate = new Date();
  6.   this.mode = mode;
  7.   this.selectMultiple = (multiselect == true); //'false' is not true or not set at all
  8.  
  9.   //the various calendar variables
  10.   //this.selectedDate = this.curDate;
  11.   this.selectedDates = new Array();
  12.   this.calendar;
  13.   this.calHeading;
  14.   this.calCells;
  15.   this.rows;
  16.   this.cols;
  17.   this.cells = new Array();
  18.  
  19.   //The controls
  20.   this.monthSelect;
  21.   this.yearSelect;
  22.  
  23.   //standard initializations
  24.   this.mousein = false;
  25.   this.calConfig();
  26.   this.setDays();
  27.   this.displayYear = this.displayYearInitial;
  28.   this.displayMonth = this.displayMonthInitial;
  29.  
  30.   this.createCalendar(); //create the calendar DOM element and its children, and their related objects
  31.  
  32.   if(this.mode == 'popup' && targetelement && targetelement.type == 'text') //if the target element has been set to be an input text box
  33.   {
  34.     this.tgt = targetelement;
  35.     this.calendar.style.position = 'absolute';
  36.     this.topOffset = this.tgt.offsetHeight; // the vertical distance (in pixels) to display the calendar from the Top of its input element
  37.     this.leftOffset = 0;           // the horizontal distance (in pixels) to display the calendar from the Left of its input element
  38.     this.calendar.style.top = this.getTop(targetelement) + this.topOffset + 'px';
  39.     this.calendar.style.left = this.getLeft(targetelement) + this.leftOffset + 'px';
  40.     document.body.appendChild(this.calendar);
  41.     this.tgt.calendar = this;
  42.     this.tgt.onfocus = function () {this.calendar.show();}; //the calendar will popup when the input element is focused
  43.     this.tgt.onblur = function () {if(!this.calendar.mousein){this.calendar.hide();}}; //the calendar will popup when the input element is focused
  44.   }
  45.   else
  46.   {
  47.     this.container = targetelement;
  48.     this.container.appendChild(this.calendar);
  49.   }
  50.  
  51.   this.state = 2; //0: initializing, 1: redrawing, 2: finished!
  52.   this.visible ? this.show() : this.hide();
  53. }




y aqui es cuando lo quiero llamar en la hoja php


<script type="text/javascript">
{literal}
var bas_cal,dp_cal,ms_cal;
window.onload = function () {
dp_cal = new Epoch('epoch_popup','popup',document.getElementByI d('popup_container'));

};
</script>


Gracias!