Making this work with onclick...help!?

I have this code, that i want to work on an onclick..on a submit button.

Here's the code

<script language="javascript" src="xp_progress.js"></script>

<script type="text/javascript">
var bar1= createBar(300,15,'white',1,'black','blue',85,7,3,"");
</script>

Heres the link to the progress bar (js file)
http://www.dynamicdrive.com/dynamicindex11/xpprogressbar.htm

Any help would be great!
jmingoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RoonaanCommented:
<input type="button" onclick="createBar(300,15,'white',1,'black','blue',85,7,3,'');" />

-r-
jmingoAuthor Commented:
thanks for the comment....

i seem to get this

'undefined' is null or not an object...

any ideas?
mvan01Commented:
Hi jmingo,

Here's a working example.  The code actually needs to be in the body, to position the bar.  So, you create it and immediately hide it.  The button just displays it.

Peace and joy.  mvan

<html>
<head>
<title>mvan - Q_21809673 solution</title>

<script language="javascript" src="xp_progress.js"></script>

</head>
<body>
Hello<br>

<input type="button" onclick="javascript:bar1.showBar()" />

<script type="text/javascript">
var bar1= createBar(300,15,'white',1,'black','blue',85,7,3,"");
bar1.hideBar();
</script>
</body>
</html>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

mvan01Commented:
Oh yeah, that button will actually look better if you put some text on it, like this:

<input type="button" value="Show Progress" onclick="javascript:bar1.showBar()" />

Peace and joy.  mvan
jmingoAuthor Commented:
thanks.. works great
mvan01Commented:
You are welcome.  Peace and joy.  mvan
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.