Please help me with this, simple idea

H

helpfulmaid

Hello, I want a function that when it detects the left mouse button is
pressed down, will generate and cycle 5 random number/letter
combinations as fast as it can in a printed space. If I let off the
mouse button then it should stop, and it can re-start again when
pressed, etc..... can someone help help? :)
 
H

helpfulmaid

Lol, thanks for throwing cold water over my theory... I have heard
rumors about you! Please don't post to this thread or it will be
considered harassment and treated as such.
 
E

Evertjan.

wrote on 08 mei 2007 in comp.lang.javascript:
Lol, thanks for throwing cold water over my theory... I have heard
rumors about you! Please don't post to this thread or it will be
considered harassment and treated as such.

It is not clear what and who you mean.

[please always quote on usenet]
 
H

helpfulmaid

It is not clear what and who you mean.

What is unclear Evertjan the reply pertaining to Randy Webb?? I don't
assume you mean the original post is unclear. What is your cause now?
 
E

Evertjan.

wrote on 08 mei 2007 in comp.lang.javascript:
What is unclear Evertjan the reply pertaining to Randy Webb?? I don't
assume you mean the original post is unclear. What is your cause now?

You did not quote, so how are we to know that your "reply pertained to
Randy Webb", if you do not, as required by netiquette, quote.

Please follow usenet netiquette on usenet.
 
H

helpfulmaid

Please follow usenet netiquette on usenet.


Please follow basic human etiquette. Sorry for you not having a keen
grasp of the obvious in the ridiculously short 2 message thread you
could not make associated connections to. I think you just wanted to
pitch a knife-fight vs. your honest claim you could not make heads or
tails of it? Sure. Please do not post here either unless you want to
help. Unless I am wrong, Ok?

-Cindy
 
A

ASM

(e-mail address removed) a écrit :
Please follow basic human etiquette.

Human is not a computer, he could be lost in all those post ...
and netiket is a good practice to follow for his convenience.
Please do not post here either unless you want to
help. Unless I am wrong, Ok?

If you want an help, give first what exactly you want to do, and how you
try to do it.

For the moment and since 3 or 4 posts you're wrong and only blow wind.
 
S

shimmyshack

Please follow basic human etiquette. Sorry for you not having a keen
grasp of the obvious in the ridiculously short 2 message thread you
could not make associated connections to. I think you just wanted to
pitch a knife-fight vs. your honest claim you could not make heads or
tails of it? Sure. Please do not post here either unless you want to
help. Unless I am wrong, Ok?

-Cindy

this function from phpmyadmin
so you shouldnt use it verbatim unless you then GPL you source code.

/**
* Generate a new password, which may then be copied to the form
* with suggestPasswordCopy().
*
* @param string the form name
*
* @return boolean always true
*/
function suggestPassword() {
var pwchars =
"abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ.,:";
var passwordlength = 16; // do we want that to be dynamic? no,
keep it simple :)
var passwd = document.getElementById('generated_pw');
passwd.value = '';

for ( i = 0; i < passwordlength; i++ ) {
passwd.value += pwchars.charAt( Math.floor( Math.random() *
pwchars.length ) )
}
return passwd.value;
}


you need markup like so
<input id="button_generate_password" value="Generate"
onclick="suggestPassword()" type="button">
<input name="generated_pw" id="generated_pw" type="text">

now all you need is
*set the number of digits to 5 as required
*an onmousedown instead of onclick to call the function
*a way of using setInterval with a certain number of milliseconds to
repeat the triggering of the suggestPassword function
*an onmouseup event, which cancels this.
 
S

scripts.contact

Hello, I want a function that when it detects the left mouse button is
pressed down, will generate and cycle 5 random number/letter
combinations as fast as it can in a printed space. If I let off the
mouse button then it should stop, and it can re-start again when
pressed, etc..... can someone help help? :)

first- add this onmousedown event to element:
<div onmousedown="if(event.which||event.button===1)randGen(this)"
Please Click Me</div>


then in function randGen :

function randGen(rD){
while(rD.childNodes.length)
rD.removeChild(rD.childNodes[0])
var x=Math.round(89999*Math.random())+10000
rD.appendChild(document.createTextNode(x))
}

Example:


<div onmousedown="if(event.which||event.button===1)randGen(this)">
Press left mouse button
</div>
<script>
function randGen(rD){
while(rD.childNodes.length)
rD.removeChild(rD.childNodes[0])
var x=Math.round(89999*Math.random())+10000
rD.appendChild(document.createTextNode(x))
}
</script>
 
G

Geoffrey Summerhayes

Lol, thanks for throwing cold water over my theory... I have heard
rumors about you! Please don't post to this thread or it will be
considered harassment and treated as such.

Your theory seems to be, "Asking strangers to write
code for free is easier and cheaper than expending
any effort trying to learn to do it myself. I can look
at my pr0n collection, wait for the answer to drop
into my lap, and get a A on the assignment."

That theory seems to be shared by a lot of people and,
unfortunately, works in a lot of comp.lang NGs, including
this one. But not all, thank goodness, some of them
want to see people make an effort for themselves before
plopping an answer down.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
oglegroups.com>, Tue, 8 May 2007 07:31:51, scripts.contact
var x=Math.round(89999*Math.random())+10000

That generates values from 10000 to 99999, but the first and last are
only half as likely to occur than any of the others.

Please read and understand the newsgroup FAQ before posting code; that
should diminish the propagation of bad code.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top