Javascript alert box doesn't disappear in IE everytime I hit submit button.

They have: 2 posts

Joined: Apr 2011

Hi,
This is my very first day in this website forum. I've been forced to singup with this forum because I am going through a very little but crucial error. Hope I'll get some help.

I've made a 'quotation request' form in my site. It works perfectly in firefox but when I try it in Internet Explorer the alert box keeps coming everytime I hit submit button.

The website is about 16 seater minibus. and the form is about customers requesting quotations for their journey. I am going to copy and paste my codes so you will have a better idea.

JavaScript

var submitcount=0;

function reset() {
document.callback.departure.value="";
document.callback.destination.value="";
document.callback.date1.value="";
document.callback.selection.value="";
document.callback.selection1.value="";
document.callback.passengers.value="";
document.callback.selection2.value="";
document.callback.selection3.value="";
document.callback.name.value="";
document.callback.phone.value="";
document.callback.email.value="";
document.callback.how.value=""
}

function checkFields() {
if (
(document.callback.departure.value=="") ||
(document.callback.destination.value=="") ||
(document.callback.date1.value=="") ||
(document.callback.selection.value=="") ||
(document.callback.selection1.value=="") ||
(document.callback.passengers.value=="") ||
(document.callback.selection2.value=="") ||
(document.callback.selection3.value=="") ||
(document.callback.name.value=="") ||
(document.callback.phone.value=="") ||
(document.callback.email.value=="") ||
(document.callback.how.value==""))
{
alert("Please enter all required fields.");
return false;
}

else
{
if (submitcount == 0)
{
submitcount++;
return true;
}
else
{
alert("This form has already been submitted.");
return false;
}
}
}
// End SCRIPT

Another Javascript
(This javascript is to hide and display Returns date/time)
function display(obj,id1) {
txt = obj.options[obj.selectedIndex].value;
document.getElementById(id1).style.display = 'none';
if ( txt.match(id1) ) {
document.getElementById(id1).style.display = 'table-row';
}
}
End script

So the thing is, it works absolutely fine in firefox but when I open it in IE and fill required fields or even all fields and i recieve an alert message that I've written in JS (Please enter all required fields.). It doesn't go through.

My question is, how can I make it work in IE as well. I have IE8 installed in my PC.
PLEASE HELP!

They have: 2 posts

Joined: Apr 2011

Hi Everyone, I thought this site is helpful but no. you people are useless. i posted my thread on 2nd of April and haven't received even a single reply yet. thank you so much for wasting my time,

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.