Date Chooser from Popup-II

[Total: 0    Average: 0/5]

This will allow the user to enter a date by a graphical method.

Head Code:

<link rel='stylesheet' type='text/css' media='all' href='/data/ex_1099/calendar.css'>
<script type='text/javascript' src='/data/ex_1099/calendar.js'></script>
<script type='text/javascript' src='/data/ex_1099/calendar-en.js'></script>
<script type='text/javascript' src='/data/ex_1099/calendar-setup.js'></script>

Body Code:

<form name="my_form" method=GET>
<input type=hidden name="PASSMonth">
<input type=hidden name="PASSDay">
<input size=10 value='' type='text' name='temp_date' id='date_input_1' readonly='1'>
<img src='/data/ex_1099/img.gif' id='date_trigger_1' style='cursor: pointer; border: 1px solid red;' title='Choose Date' onmouseover='this.style.background="red";' onmouseout='this.style.background=""'>
<input type=submit>
</form>
<script type='text/javascript'>
Calendar.setup({
inputField     :    'date_input_1',     // id of the input field
ifFormat       :    '%m/%d/%Y',      // format of the input field
button         :    'date_trigger_1',  // trigger for the (button ID)
align          :    'B2',           // alignment (defaults to 'Bl')
singleClick    :    true
});
</script>
<script>
var _lastTempDate="";
var _counter=0;
function checkDate()
{
  var _form=document.my_form;
  var _obj=_form.temp_date;
  if(_obj.value!=_lastTempDate)
  {
    _lastTempDate=_obj.value;
    var _args=_obj.value.split("/");
    _form.PASSMonth.value=_args[0];
    _form.PASSDay.value=_args[1];
  }
}
var TimerDate=setInterval("checkDate()",50);
</script>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *