• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

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!
0
jmingo
Asked:
jmingo
  • 3
  • 2
1 Solution
 
RoonaanCommented:
<input type="button" onclick="createBar(300,15,'white',1,'black','blue',85,7,3,'');" />

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

i seem to get this

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

any ideas?
0
 
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>
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy 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
0
 
jmingoAuthor Commented:
thanks.. works great
0
 
mvan01Commented:
You are welcome.  Peace and joy.  mvan
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now