Forum Topic: No double clicking

(412 views • 19 replies)

This topic is 1 page long.

<< < > >>
None

TheRealSwoop

Reply To Post Reply & Quote

Posted at: 11/1/05 07:36 AM

TheRealSwoop LIGHT LEVEL 10

Sign-Up: 07/08/05

Posts: 85

How do you make it so, like newgrounds, once you click the submit button you can't accidentily hit it again, and it becomes grayed out. I'm talking php wise.

Thanks in advance, Ill go search google again in the mean time.


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 11/1/05 07:46 AM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,282

It isn't handled with php, it's handled with javascript. I'll write you a quick little function, change the names if need be.

HTML form
<form name="my_form" action="blah.php" method="post">
<input type="text" name="your_name" size="30"><br />
<input type="button" name="button_dood" onMouseUp="Prevent();" value="Submit!">
</form>

Javascript
<script language="javascript" type="text/javascript">
function Prevent() {
document.my_form.button_dood.disabled = true;
document.my_form.button_dood.value = 'Processing Form...';
document.my_form.submit();
} // End function
</script>

If you need to change the name of your form you would do this for all the lines in the javascript function:
Replace: document.my_form.button_dood with
document.your_form_name_here.your_button_n
ame_here

Also, in document.my_form.submit(); you would change my_form with the name of your form. I think it's pretty self explanitory if you look at the entire code. Just make sure you keep the onMouseUp event for your button.

holy jesus what are these goddamn animals


None

TheRealSwoop

Reply To Post Reply & Quote

Posted at: 11/1/05 07:46 AM

TheRealSwoop LIGHT LEVEL 10

Sign-Up: 07/08/05

Posts: 85

Ok, nevermind guys, I found it. I should learn to be more patient.

=p


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 11/1/05 07:49 AM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,282

At 11/1/05 07:46 AM, SigmaStudios wrote: Ok, nevermind guys, I found it. I should learn to be more patient.

Yeah, lol :(

holy jesus what are these goddamn animals


None

TheRealSwoop

Reply To Post Reply & Quote

Posted at: 11/1/05 07:58 AM

TheRealSwoop LIGHT LEVEL 10

Sign-Up: 07/08/05

Posts: 85

At 11/1/05 07:49 AM, Pilot-Doofy wrote:
At 11/1/05 07:46 AM, SigmaStudios wrote: Ok, nevermind guys, I found it. I should learn to be more patient.
Yeah, lol :(

Oh man, you made Musty Windows! Dang, you gonna be a competitor for me as soon as I finish my portal.

I am working on IPS and limited voting now, man, I gotta finish but you probably are 1k times better then me at php and defintely javascript.

Meh, you are probably older then me though.


None

henke37

Reply To Post Reply & Quote

Posted at: 11/1/05 09:45 AM

henke37 NEUTRAL LEVEL 16

Sign-Up: 09/10/04

Posts: 2,627

I think onsubmit is a better event handler.

Move on to ActionScript 3! And please, drop the mysql PHP extension, it's so stale that it lacks features that is no longer considered new! Go mysqli or pdo instead.


None

IWantSomeCookies

Reply To Post Reply & Quote

Posted at: 11/1/05 03:16 PM

IWantSomeCookies LIGHT LEVEL 13

Sign-Up: 08/20/04

Posts: 3,291

Aww! Doofy, lol. You typed all that up and then he already found a script.

Well, I dont know if your older than him, both your ages are Unspecified. Thus, your age is the same.. :D

"Actually, the server timed out trying to remove all your posts..."
-TomFulp


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 11/1/05 04:18 PM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,282

Everyone knows I'm merely 16. My true fans know that. :)

holy jesus what are these goddamn animals


None

Rampid

Reply To Post Reply & Quote

Posted at: 11/2/05 01:18 AM

Rampid LIGHT LEVEL 04

Sign-Up: 01/02/05

Posts: 203

your plaguarizing that phpbb theme :(


None

WoogieNoogie

Reply To Post Reply & Quote

Posted at: 11/2/05 06:27 PM

WoogieNoogie LIGHT LEVEL 14

Sign-Up: 06/26/05

Posts: 3,195

At 11/2/05 01:18 AM, Rampid wrote: your plaguarizing that phpbb theme :(

If you're talking about MustyWindows, then I'm guessing you're talking about Nosebleed.
His color scheme is red, white, and black. In no way does that mean he plagurised.

If you're not talking about MustyWindows, you lost me.


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 11/2/05 09:07 PM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,282

I didn't reply to him because I didn't know who on earth he was talking about. I hoped he wasn't talking about me. Not because I was doing something illegal, but because he would be a completely idiotic douche.

holy jesus what are these goddamn animals


None

DFox

Reply To Post Reply & Quote

Posted at: 11/2/05 11:04 PM

DFox LIGHT LEVEL 30

Sign-Up: 08/09/03

Posts: 9,270

At 11/2/05 01:18 AM, Rampid wrote: your plaguarizing that phpbb theme :(

Your a complete idiot. Just because they both use red??

Before you tell people their plaguarizing, think a little bit. How would you like it if someone told you that you were plaguarizing something that you worked hard on, and you know that you didn't?

II've had people say it to me, and it's not very nice.

If you have nothing to add, then don't post, because I don't really think anyone cares what you have to say.


Happy

Phroek

Reply To Post Reply & Quote

Posted at: 11/3/05 12:02 AM

Phroek EVIL LEVEL 39

Sign-Up: 06/08/02

Posts: 463

At 11/1/05 04:18 PM, Pilot-Doofy wrote: Everyone knows I'm merely 16. My true fans know that. :)

Good show, doofy... Man, where does the time go? I've been away from this forum for a while, but I remember reading doofy's posts a couple years ago, and he's come a long way. Wasn't that long ago that he was asking other people on the forum about javascript.

Hehe ;-)


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 11/3/05 08:22 AM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,282

At 11/3/05 12:02 AM, Phroek wrote: Hehe ;-)

Yep, I look back when I first signed up a little over 2 years ago and think I was a complete idiot. I basically just read up on everything I could about everything I wanted to learn about and spent hours a day. I learned quickly because I spent so much time on it.

At first, I would try to average at least 2-3 hours a day for at least 5 days out of a week of pure reading and practice. It sounds like some Michael Jordon story or something, I just wanted to be a geek. :)

holy jesus what are these goddamn animals


None

Phroek

Reply To Post Reply & Quote

Posted at: 11/3/05 10:23 AM

Phroek EVIL LEVEL 39

Sign-Up: 06/08/02

Posts: 463

At 11/3/05 08:22 AM, Pilot-Doofy wrote: Yep, I look back when I first signed up a little over 2 years ago and think I was a complete idiot. I basically just read up on everything I could about everything I wanted to learn about and spent hours a day. I learned quickly because I spent so much time on it.

At first, I would try to average at least 2-3 hours a day for at least 5 days out of a week of pure reading and practice. It sounds like some Michael Jordon story or something, I just wanted to be a geek. :)

That's the best way to learn. Personally, I never did learn well in a classroom environment. Solo was the best way to go. Think about this: The pace that technology progresses at is so fast, that by the time you take a course on any given subject in the field and graduate months later, that technology can already be obsolete! So people like you, who can keep up with the technology, and even more so because they LIKE IT, will go far. A lot further than systems engineers who have degrees that are years old, and take three times as long to figure things out than you do.

Just keep it up, and stay interested. You could have a great job by the time you're 20 and you might not even have to go to university/college.


None

BuRnBoY

Reply To Post Reply & Quote

Posted at: 11/3/05 10:33 AM

BuRnBoY LIGHT LEVEL 13

Sign-Up: 02/29/04

Posts: 2,432

At 11/1/05 04:18 PM, Pilot-Doofy wrote: Everyone knows I'm merely 16. My true fans know that. :)

yeah.. all none of them..


None

sosjulian

Reply To Post Reply & Quote

Posted at: 11/3/05 10:43 AM

sosjulian NEUTRAL LEVEL 11

Sign-Up: 06/14/05

Posts: 680

patience is a virtue, young warior...


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 11/3/05 10:54 AM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,282

At 11/3/05 10:23 AM, Phroek wrote: You could have a great job by the time you're 20 and you might not even have to go to university/college.

I'd really like to do something with programming or something for a career but I'm scared I won't get paid enough to support a family very well.

holy jesus what are these goddamn animals


None

Phroek

Reply To Post Reply & Quote

Posted at: 11/3/05 06:03 PM

Phroek EVIL LEVEL 39

Sign-Up: 06/08/02

Posts: 463

At 11/3/05 10:54 AM, Pilot-Doofy wrote: I'd really like to do something with programming or something for a career but I'm scared I won't get paid enough to support a family very well.

The programming field is very competitive, but you can have a great career making top dollar if you sell yourself properly. Freelance might be the way to go. It always takes time to develop a good client base, but once you do, you'll find that getting new clients becomes easier and easier as time goes on.

Alternatively, just analyze the industry and try to get into what's in demand. It may not have been your first choice, but you'll very likely get a chance to do what you REALLY wanted to do eventually in your career.

You just have to have a positive attitude, be patient, and proactive. (God, do I sound like a motivational speaker or what??)


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 11/3/05 06:09 PM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,282

At 11/3/05 06:03 PM, Phroek wrote: (God, do I sound like a motivational speaker or what??)

Yes, you do. lol I'm not much of a risk taker, though.

holy jesus what are these goddamn animals


All times are Eastern Standard Time (GMT -5) | Current Time: 11:49 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!