Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Just wondering if......
Old 01-07-2009, 10:33 AM Just wondering if......
Junior Talker

Posts: 3
Name: Dave
Trades: 0
Hi
I am an oldie and am trying to make a charity website. I have an idea and have spent countless hours searching the net. I will detail what I am trying to do and maybe someone can give me some code or the idea where to go to search please. I am ok at making a website using a wysiwyg editor and then using w3c to tidy it up a bit etc but coding stuff is way outside my league.

I want to put a very simple piece of text on a page. eg Ader3Mmqz6

I then want a text box below where the people can enter the letters above. Just like a captcha but no image and it doesn't change.

All sounds simple so far...hehehehehe. I do not want the example text to change each time a button is clicked. I will just change it perhaps once a month or something.

Also, I was hoping that each time the user clicks the 'submit' button it registers say $2 per click and shows that out the side as a running total. But I can get away without that if it is a problem. And while I am asking I would also love to have a 'nice wrong' answer message the first time they click, then a 'dumber wrong' answer message the second click, and a 'really dumb' answer message the third time. But hey I guess I already asked too much.

If they get the answer correct they just get a 'whoopee' screen but if it is wrong they get a 'dumbo' message.

Just as a note I guess people are wondering why I am doing something so simple. Well about 90% of non-programmers would enter everything but the question only said letters!!!! Hehehehehe I have tried it out countless times by asking and most get it wrong.

Anyway, thanks so much everyone

Dave
butoy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-07-2009, 03:56 PM Re: Just wondering if......
AD7863's Avatar
Major Geek

Posts: 435
Name: Artful Dodger
Location: England, UK
Trades: 0
I'm not 100% sure what you need but I think you might need PHP for this...
__________________

Please login or register to view this content. Registration is FREE
AD7863 is offline
Reply With Quote
View Public Profile Visit AD7863's homepage!
 
Old 01-07-2009, 04:43 PM Re: Just wondering if......
angele803's Avatar
Perfectly Imperfect

Posts: 1,772
Name: Stephanie
Location: Oklahoma
Trades: 2
If you want the totals to refresh for each user or each time the user visits the page, I think you could accomplish this with some javascript.

You could set up a javascript variable to set and alter the running total. You could also put a counter variable with it to track how many times the button was clicked.
So your code would follow this pattern:
Code:
When the button is clicked, do this:
   Add 1 to the click counter variable;
   Add $2 to the running total;
   If answer is correct:
       display a congrats message
   If answer is wrong and click counter = 1
       display dumb message
   If answer is wrong and click counter = 2
       display dumber message
   If answer is wrong and click counter = 3
       display really dumb message
   If answer is wrong and click counter is anything else
      display some other message
If this sounds like what you want to do, I am sure we could help you write the code. It should be fairly easy.
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 01-07-2009, 09:19 PM Re: Just wondering if......
Junior Talker

Posts: 3
Name: Dave
Trades: 0
Thanks everyone and especially Angele.

You are correct as to what I am wishing to do.

At the moment I haven't really done much at all other than create a blank webpage with a submit button and text box. Pretty dumb huh!!!!. But I did spend hours trying to find even little bits of code to play around with but nothing that would work the way I want.
Anyway Angele, if you can draft some basic code for me I will be very grateful. To an extent I am capable of altering it to suit but it is the basic starting code I am after if you could help.

Happy new year
Dave
butoy is offline
Reply With Quote
View Public Profile
 
Old 01-08-2009, 02:15 PM Re: Just wondering if......
angele803's Avatar
Perfectly Imperfect

Posts: 1,772
Name: Stephanie
Location: Oklahoma
Trades: 2
Maybe something like this...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Quiz</title>
<script type="text/javascript">
var clickCounter=0;
var runningTotal=0;
var correctAnswer="ABC123"

function processClick(){
	clickCounter += 1
	if (document.quiz.entered.value == correctAnswer){
			alert("You are right!");
			runningTotal += 2
			document.getElementById('total').innerHTML = runningTotal;
			return false;
			}
        else{
		switch(clickCounter)
		{
		case 1:
		  alert("Well, we all make mistakes. Try again.");
		  break;    
		case 2:
		  alert("Come On, it isn't really that hard.");
		  break;
		case 3:
		  alert("I guess we know you aren't smarter than a 5th grader.");
		  break;
		default:
		  alert("You should just give up now");
		  break;
		}
	}
}
</script>
</head>

<body>


<form name="quiz">
	<input type="text" disabled="disabled" value="ABC123" />
	<p>Enter the text found in the box above: <input type="text" name="entered" /></p>
	<input type="button" value="submit" onClick="processClick()" />
</form>
<p>Your total is $<span id="total">0</span></p>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 01-08-2009, 02:26 PM Re: Just wondering if......
AD7863's Avatar
Major Geek

Posts: 435
Name: Artful Dodger
Location: England, UK
Trades: 0
Cool, I can't really do javascript. I tend to stick to HTML/CSS. Gonna try and learn javascript soon lol.
__________________

Please login or register to view this content. Registration is FREE
AD7863 is offline
Reply With Quote
View Public Profile Visit AD7863's homepage!
 
Old 01-11-2009, 05:53 AM Re: Just wondering if......
Novice Talker

Posts: 15
Name: Jamal
Trades: 0
this is helpful for the people who are looking for some help around this and i am one of them
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
scriptbazaar is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 10:11 AM Re: Just wondering if......
Junior Talker

Posts: 3
Name: Dave
Trades: 0
Hello again

Thanks soooooooooooo much Angel......you really are an Angel.

It works just perfectly except for the running total, but I will spend a feq hours trying to sort out that.

Again thanks so much

Dave
butoy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Just wondering if......
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35005 seconds with 12 queries