javascript popup not firing


I'm using a javascript calendar I found on the web, which I'm hoping
will invoke a popup. For some reason, it almost looks like rails is
squelching it. From my view:

<script language="javascript"
<script language="javascript1.2">
var caldef1 =
  firstday : 0,
  dtype : 'MM/dd/yyyy',
  width : 275,
  windoww : 300,
  windowh : 200,
  border_width : 0,
  border_color : 'White',
  multi : true,
  spr : '\r\n',
  dn_css : 'clsDayName',
  cd_css : 'clsCurrentDay',
  tw_css : 'clsCurrentWeek',
  wd_css : 'clsWorkDay',
  we_css : 'clsWeekEnd',
  wdom_css : 'clsWorkDayOtherMonth',
  weom_css : 'clsWeekEndOtherMonth',
  wdomcw_css : 'clsWorkDayOthMonthCurWeek',
  weomcw_css : 'clsWeekEndOthMonthCurWeek',
  wecd_css : 'clsWeekEndCurDay',
  wecw_css : 'clsWeekEndCurWeek',
  preview_css : 'clsPreview',
  highlight_css : 'clsHighLight',
  headerstyle :
    type : 'buttons',
    css : 'clsDayName',
    imgnextm : '../public/images/forward.jpg',
    imgprevm : '../public/images/back.jpg',
    imgnexty : '../public/images/forward.jpg',
    imgprevy : '../public/images/back.jpg'
  imgapply : '../public/images/apply.gif',
  preview : true,
  monthnames : ['January', 'February', 'March', 'April', 'May', 'June',
    'August', 'September', 'October', 'November', 'December'],
  daynames : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
  txt : ['Previous year', 'Previous month', 'Next month', 'Next year',
var c1 = new CodeThatCalendar(caldef1);
  <P>Month+year scrollers</P>
    <input name="id1" type="textarea"/>
    <input type="button" onClick="c1.popup('id1');" value="..."/>

Since this is pure javascript/html, i can't understand why it's not
popping up. Is rails squelching it for some reason? If so, why & how
do I fix it.

If I'm down the wrong path - howabout a good on-page calendar for rails
that will populate a field when a date is clicked on? I found
calendargrid but didn't have much luck getting it to work.


First off, go get Firebug ( It’s invaluable for web, especially javascript, development. It will let you know where the error is if there is one.

From first glance though, make sure you have type=“text/javascript” in your tag, that’s thrown me a few times. Otherwise, there’s probably a javascript compiler error, which Firebug will tell you about.