Hi there. I am having some problems with a Javascript currently. I’m a bit of an amateur with Javascript and had someone develop this script for me. I’ve since modified it, but I’m stuck on the last little hurdle. Here’s what’s up:
It’s a formhandler, and the script was developed with an alert that pops up. I would prefer for a loadbar to show for a few seconds in a div, and then another div to open when it’s successfully submitted with ‘success!’ written in it. I can get the script to display the ‘success!’ div no problem. I’m stuck on the loadbar, and I believe it’s because of the extra function I’ve created.
My code:
[CODE]
//This first function should display the ‘processing’ bar for 3 seconds, and then the next function, which processes the form
//it does display the processing bar, but does not move on to the next function.
//I think it has something to do with the variables not being presented properly. (They’re in a variable called ‘x’ I believe).
function SubmitForm1(x)
{
document.getElementById(“processing”).style.display = “block”;
setTimeout ( “ProcessingBar(x)”, 3000 );
}
function ProcessingBar(x)
{
if( x.posName.value != “” && x.posEmail.value != “”)
{
x_SendEmailFrom1(x.posName.value,x.posEmail.value,x.posPhone.value,x.posAddress.value,x.posRequestedProduct.value,ShowMessage1);
}
else
{
ShowMessage1(0);
}
}
function ShowMessage1(result)
{
if(result)
{
document.getElementById(‘success’).style.display = ‘block’;
document.getElementById(‘processing’).style.display = ‘none’;
}
else
{
alert(“There was a problem with your submission.”);
}
}
I’d really appreciate any help getting to the bottom of this!
address of the site it’s used on is:
[url]http://www.c1systems.co.uk
on the ‘evaluate a product’ link on the right.