/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Problem creating loading bar, nearly there…

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.”);
}
}[/CODE]

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[/url]
on the ‘evaluate a product’ link on the right.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@FangApr 14.2009 — setTimeout(function(){return ProcessingBar(x);}, 3000);
Copy linkTweet thisAlerts:
@chickenshoesauthorApr 14.2009 — Works perfectly!

Thank you ever so much for your help!

Simon
Copy linkTweet thisAlerts:
@chickenshoesauthorApr 14.2009 — how do I mark posts as solved?
Copy linkTweet thisAlerts:
@astupidnameApr 14.2009 — At the top, click on thread tools, mark as resolved
Copy linkTweet thisAlerts:
@chickenshoesauthorApr 14.2009 — thanks, sorted
×

Success!

Help @chickenshoes spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...