Hi Cathal,
Thanks for having a look at that. You right about the missing fields, when the script is working fine (on the DNN 4 site) it draws three input boxes at the top of the form were you enter the month, day and year. When I view the form in the editor design mode you can see two of the fields being rendered, but when I hit save and look at the form those fields aren't there. The editor in DNN4 behaves the same way excpet than when you view the page it draws the three boxes.
So it looks like DNN 5 is having trouble drawing the three fields and thus the javascript error about not being able to find them. I'm not a javascript gun, but it looks like the included JS file is supposed to draw the fields and do the calculations.
Below is the content of the HTML box on the page, and the included JS file can be viewed at
http://www.sufw.31.websecurestores.co...
You'll notice that the JS script is included from the HTML text, but I've also tried to put it in the Page header and that makes no difference.
Once again thanks fo having a look at this.
Cheers Greg
<!-- CONTENT BEGIN .. --> <!--
Pregnancy Dates Calculator
February 28, 1999
This calculator was created by Charles Hu for the Medical College of
Wisconsin General Internal Medicine Clinic. This calculator may not be
copied without the consent from the author. chuckhu@hotmail.com--> <script language="JavaScript" src="/js/pregnant.js"></script> <center>
<table cellspacing="0" cellpadding="3" border="0" bgcolor="#eeeeee">
<form method="post" name="DueDate">
<input type="hidden" name="theDate" />
<tbody>
<tr bgcolor="#e3e9f8">
<td align="center" colspan="2"><strong> Last menstrual period : </strong> <script language="JavaScript">
<!--
var today = new Date();
var mm = today.getMonth();
var dd = today.getDate();
var yy = today.getYear();
// The '0' indicates this does NOT come from EDD Form
dateSelect(mm,dd,yy,0);
// -->
</script></td>
</tr>
<tr bgcolor="#e3e9f8">
<td align="center" colspan="2"><input type="button" onclick="dueDate(this.form)" value="Calculate Forward" name="button" /> <input type="button" onclick="resetForm()" value="Reset This Form" name="button" /></td>
</tr>
<tr>
<td align="right">Conception Occurred : <br />
<!--chuckhu conceived--> <font size="-1"><em> (about two weeks after last menstrual period) </em></font></td>
<td valign="middle" align="left"> <!--input type=text value="" size="30" maxlength="30" name="concep"--></td>
</tr>
<tr>
<td align="right">First Trimester Ends <font size="-1"><em> (12 weeks) </em></font>:</td>
<td valign="top" align="left"> <!--input type=text value="" size="30" maxlength="30" name="first"--></td>
</tr>
<tr>
<td align="right">Second Trimester Ends <font size="-1"><em> (27 weeks) </em></font>:</td>
<td valign="top" align="left"> <!--input type=text value="" size="30" maxlength="30" name="second"--></td>
</tr>
</tbody>
<form method="post" name="eddForm">
<input type="hidden" name="theDate" />
<tr bgcolor="#e3e9f8">
<td align="right"><strong> Estimated Due Date</strong> <font size="-1"><em> (40 weeks) </em></font>:</td>
<td> <script language="JavaScript">
<!--
var today = new Date();
var mm = today.getMonth();
var dd = today.getDate();
var yy = today.getYear() + 1;
// The last '1' indicates this comes from the EDD form
dateSelect(mm,dd,yy,1);
// -->
</script></td>
</tr>
<tr bgcolor="#e3e9f8">
<td align="center" colspan="2"><input type="button" onclick="getLMP(this.form)" value="Calculate Backward" name="button" /></td>
</tr>
</form>
</form>
</table>
<form method="post" name="weeksPreg">
<input type="hidden" value="0" name="calcYet" /> <input type="hidden" name="theDate" />
<table cellspacing="0" cellpadding="5" border="0" bgcolor="#ccccff">
<tbody>
<tr>
<td align="center">On <script language="JavaScript">
<!--
var today = new Date();
var mm = today.getMonth();
var dd = today.getDate();
var yy = today.getYear();
// The last '2' indicates this comes from EGA form
dateSelect(mm,dd,yy,2);
// -->
</script>, you will be <input type="text" name="weeks" size="6" /> weeks pregnant.</td>
</tr>
<tr>
<td align="center"><input type="button" onclick="datetoWeeks(this.form)" value="Calculate Date --> Weeks" name="button" /> <input type="button" onclick="weekstoDate(this.form)" value="Calculate Weeks --> Date" name="button" /></td>
</tr>
</tbody>
</table>
</form>
</center> <!-- .. CONTENT END -->