Kristen Jones
asked on
Javascript broken in Chrome & FF but ok in Explorer
There is a page at http://www.miamiconservancy.org/Water_Data/GWLevels/WellDataDisplay2live.asp?wellname=BUT00013 with JavaScript that has been working for years w/o problems. It was discovered recently that in Chrome or firefox when you click the View Graph or Download data it does not submit the date range. The date range is computed using JavaScript function CheckDates on the form post
I am hoping for a copy/paste solution to the problem as I don't know JavaScript much
function CheckDates() {
//alert ("<%=day(mindate)%>");
//var s,e
//s=new Date()
//s.setMonth(SetDate.start m.options( SetDate.st artm.selec tedIndex). value );
//s.setYear(SetDate.starty .options(S etDate.sta rty.select edIndex).v alue);
//s.setDate(SetDate.startd .options(S etDate.sta rtd.select edIndex).v alue);
if (SetDate.startd.options(Se tDate.star td.selecte dIndex).va lue > 31) {
alert ("Invalid date. Please specify again.");
return false;
}
Dates.datestart.value = SetDate.startm.options(Set Date.start m.selected Index).val ue + "/" + SetDate.startd.options(Set Date.start d.selected Index).val ue + "/" + SetDate.starty.options(Set Date.start y.selected Index).val ue;
GraphDates.datestart.value = SetDate.startm.options(Set Date.start m.selected Index).val ue + "/" + SetDate.startd.options(Set Date.start d.selected Index).val ue + "/" + SetDate.starty.options(Set Date.start y.selected Index).val ue;
//alert (Dates.datestart.value);
//e=new Date()
//e.setMonth(SetDate.endm. options(Se tDate.endm .selectedI ndex).valu e );
//e.setYear(SetDate.endy.o ptions(Set Date.endy. selectedIn dex).value );
//e.setDate(SetDate.endd.o ptions(Set Date.endd. selectedIn dex).value );
if (SetDate.endd.options(SetD ate.endd.s electedInd ex).value > 31) {
alert ("Invalid date. Please specify again.");
return false;
}
Dates.dateend.value = SetDate.endm.options(SetDa te.endm.se lectedInde x).value + "/" + SetDate.endd.options(SetDa te.endd.se lectedInde x).value + "/" + SetDate.endy.options(SetDa te.endy.se lectedInde x).value;
GraphDates.dateend.value = SetDate.endm.options(SetDa te.endm.se lectedInde x).value + "/" + SetDate.endd.options(SetDa te.endd.se lectedInde x).value + "/" + SetDate.endy.options(SetDa te.endy.se lectedInde x).value;
//alert (Dates.dateend.value);
return false;
}
</script>
I am hoping for a copy/paste solution to the problem as I don't know JavaScript much
function CheckDates() {
//alert ("<%=day(mindate)%>");
//var s,e
//s=new Date()
//s.setMonth(SetDate.start
//s.setYear(SetDate.starty
//s.setDate(SetDate.startd
if (SetDate.startd.options(Se
alert ("Invalid date. Please specify again.");
return false;
}
Dates.datestart.value = SetDate.startm.options(Set
GraphDates.datestart.value
//alert (Dates.datestart.value);
//e=new Date()
//e.setMonth(SetDate.endm.
//e.setYear(SetDate.endy.o
//e.setDate(SetDate.endd.o
if (SetDate.endd.options(SetD
alert ("Invalid date. Please specify again.");
return false;
}
Dates.dateend.value = SetDate.endm.options(SetDa
GraphDates.dateend.value = SetDate.endm.options(SetDa
//alert (Dates.dateend.value);
return false;
}
</script>
ASKER
You are correct, you can see the page at the link in the original post and view source. I tried your code and refreshed using Chrome and still does not submit the date. I have code at the top right that will display a date if the post is successful .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
:) that was it.. THANKS!!!!
You're welcome.
For future reference, the correct answer was in my first comment. The second comment which was to correct an error that was introduced while implementing the first correction.
For future reference, the correct answer was in my first comment. The second comment which was to correct an error that was introduced while implementing the first correction.
Open in new window