Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 31st, 2003, 12:41 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Full code to help me change button to image

<HTML>
<HEAD>

<SCRIPT LANGUAGE=JavaScript>

function cmdStartQuiz_onclick()
{
   var cboNoQuestions = document.frmQuiz.cboNoQuestions;
   var noQuestions = cboNoQuestions.options[cboNoQuestions.selectedIndex].value;
   var cboTimeLimit = document.frmQuiz.cboTimeLimit;
   var timeLimit = cboTimeLimit.options[cboTimeLimit.selectedIndex].value;
   window.top.fraTopFrame_aplus1.fraGlobalFunctions_a plus1.resetQuiz(noQuestions,timeLimit);

   window.location.href = "AskQuestion_aplus1.htm";
}

</SCRIPT>
</HEAD>
<BODY bgcolor="#ffffff">
<center>

<FORM NAME="frmQuiz">
<img src="simulator_a+_exam1_black_orange.gif">
<br>
Select Number of Questions
<SELECT name=cboNoQuestions size=1>
   <OPTION value=10>10
   <OPTION value=25>25
   <OPTION value=50>50
</SELECT>
&nbsp;&nbsp;&nbsp;Set Time Limit
<SELECT name=cboTimeLimit size=1>

   <OPTION value=600>10 Minute
   <OPTION value=1800>30 Minutes
   <OPTION value=3600>60 Minutes
   <OPTION value=-1>No Time Limit
</SELECT>

<p>
   <INPUT NAME=cmdStartQuiz TYPE=button VALUE="Start Quiz"
   onclick="return cmdStartQuiz_onclick()">
</FORM>

</BODY>
</HTML>


__________________
Rudy
 
Old October 31st, 2003, 01:47 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Larry,

I am not 100% sure what you're trying to accomplish by posting all this code. If it's relevant to another topic, post it as a reply to that topic.

If it's a new topic, please specify the question and some background.

By making posts like this, you're just messing up the forum, IMO.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 31st, 2003, 01:58 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm trying to get someone help me to change my existing code from a js button to an image button. To do that, they (those that are willing to help) will need to see my existing code. There isn't much code here, maybe twenty lines, I dought its messing up the forum. That's what this forum is for, people who need help with the code that is a part of the "Beginning JavaScript" book, which I did. If you don't with to contribute by helping me with this, thats up to you, simply ignore my posts.

 
Old October 31st, 2003, 04:52 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am not saying you're messing up the forum by posting code, I am saying that you're messing up the forum by posting the same topic in multiple posts.

Imagine someone from a search engine finding your initial post in some time. They may think: "Hey, that's exactly the same problem I have". They'll open the message, only to find out the answer isn't there because it's in a different post. This can be very frustrating. Also, somebody willing to help you now would now need to track multiple posts to see who has answered what in what thread.

I am more than willing to help (I think if you take a look at the questions I have answered before here you can see what I mean). All I am trying to do is help make this forum as useful as it can be. Simple rules (like posting replies to the initial post, and creating new posts for new topics) help keep this forum clean, on-topic, easy to use and hopefully as problem-solving as possible.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 31st, 2003, 05:06 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This was my first time posting, excuse me! Nice Welcome.
I posted several times because they each had a different question although they did have similar subject lines. Each time I posted I got a answer from someone by the name of Phil and he helped solve my problem both times. I had one more guestion for him (or anyone that could/would help, but it was a different question than the previous two questions.
 
Old October 31st, 2003, 05:15 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, well I have no intention to be rude. Welcome.... ;)
(If it's a different question, you may want to explain your question in some more detail. Not everyone will read all posts here and just guessing what you're trying to accomplish from just the subject line may be just a little too much). After all, people are here to help, not to waste time trying to figure out what the question is in the first place.

If all you need to do is change a HTML button into an image, this would work:

<img src="/PathToImage/MyImage.gif" onclick="return cmdStartQuiz_onclick();">

Alternatively, you can wrap the entire image in a <a> tag, and have it link to "JavaScript:cmdStartQuiz_onclick();" or have it link to "#" and add the same onclick handler as the original button or the image.

Does that help?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 31st, 2003, 05:58 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help, I'll try to be more effecient with my postings in the future.


Quote:
quote:Originally posted by Imar
 Right, well I have no intention to be rude. Welcome.... ;)
(If it's a different question, you may want to explain your question in some more detail. Not everyone will read all posts here and just guessing what you're trying to accomplish from just the subject line may be just a little too much). After all, people are here to help, not to waste time trying to figure out what the question is in the first place.

If all you need to do is change a HTML button into an image, this would work:

<img src="/PathToImage/MyImage.gif" onclick="return cmdStartQuiz_onclick();">

Alternatively, you can wrap the entire image in a <a> tag, and have it link to "JavaScript:cmdStartQuiz_onclick();" or have it link to "#" and add the same onclick handler as the original button or the image.

Does that help?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
pro php5 full source code jontywagener Pro PHP 3 November 1st, 2007 01:33 AM
VB Edition C7, Full Errata and New Code Downloads DanM BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 October 3rd, 2006 03:51 PM
Change existing browser window to full screen ednaswap Javascript 0 August 17th, 2006 08:41 PM
Make a image button as default submit button toshi ASP.NET 1.0 and 1.1 Basics 1 June 1st, 2006 05:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.