?
Solved

Making this work with onclick...help!?

Posted on 2006-04-11
6
Medium Priority
?
231 Views
Last Modified: 2012-05-05
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
Comment
Question by:jmingo
  • 3
  • 2
6 Comments
 
LVL 49

Expert Comment

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

-r-
0
 

Author Comment

by:jmingo
ID: 16426972
thanks for the comment....

i seem to get this

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

any ideas?
0
 
LVL 11

Accepted Solution

by:
mvan01 earned 160 total points
ID: 16427321
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Expert Comment

by:mvan01
ID: 16427341
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
 

Author Comment

by:jmingo
ID: 16427677
thanks.. works great
0
 
LVL 11

Expert Comment

by:mvan01
ID: 16427823
You are welcome.  Peace and joy.  mvan
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question