...

View Full Version : Javascript problem



apsomum
06-14-2010, 11:03 PM
I have an html page with javascript on it, but the page will not work properly. Spent a lot of time on this and can not get it right.
Wonder if someone ca help.:rolleyes:

apsomum
06-14-2010, 11:08 PM
Im new to this and not sure how to proceed, sorry!

apsomum
06-14-2010, 11:17 PM
My son has been trying to put this code into one of my pages for my new site and is having trouble with the code (java script). I think the code needs to be edited and then the code to out put the pop-up and its contents.

My son knows html, and jvascript is not really his thing. He has spent a lot of time and cant get it to work.

coothead
06-14-2010, 11:22 PM
Hi there apsomum,

and a warm welcome to these forums. ;)

A link to your problematic site would enable the members to possibly assist you in your hour of need. :)

coothead

apsomum
06-14-2010, 11:52 PM
Hi there apsomum,

and a warm welcome to these forums. ;)

A link to your problematic site would enable the members to possibly assist you in your hour of need. :)

coothead

Thank you for advising me of what to do..

The page in question is http://keris-lhasa.com/keris-whelping-calculator.html

Thank you

Old Pedant
06-15-2010, 05:40 AM
There are just *SO* many things I would change about that page that it's hard to start.

But the first error seems to be that he has forms[1] and forms[0] reversed.

The easiest way to be sure you are referring to the correct form is to *NAME* THEM!!!

Instead of just
<form>
use
<form name="dateInfo">
and then all your code that is currently doing

document.forms[1].xxx

should become

document.dateInfo.xxx

or, even better, at the top of the validation code it like this:

function Validate()
{
var form = document.dateInfo;
if((form.month.options[1].selected==true
&& form.year.options[0].selected ==true)
&& (form.day.options[29].selected ==true
|| form.day.options[30].selected ==true)) {
alert("Wrong date! Maximum days in February, 1996: 29");
return false;
};
... etc. ...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum