How to code something like this?
2014-01-23, 02:11 PM,
So I'm wondering how do I code something like this.

There's a Generate button, next to it, there's a box. When the user hits the button it displays a code like this 999-8726-1111-XXXX?

How do I do it?
Share This Thread :

2014-01-23, 08:21 PM,
2014-01-23, 08:27 PM,
2014-01-24, 11:25 AM,
I'm going to code it for a website *-*
2014-01-24, 11:42 AM,
(2014-01-24, 11:25 AM)ajet369 Wrote: I'm going to code it for a website *-*

Good luck! if you need need any help send me a pm.

Your Future Isn't Programmed.
Learn All You Can, While You Can.
2014-01-24, 11:46 AM,
(2014-01-24, 11:25 AM)ajet369 Wrote: I'm going to code it for a website *-*

I have coded some online generator like that pm me if intrested
2014-01-24, 12:10 PM,
If it's for a website, you could use HTML (and CSS) + PHP. Otherwise, if it's a computer program, you can get it done in almost any language (C, C++, C#, VB.NET, Delphi etc)
2014-01-24, 12:16 PM, (This post was last modified: 2014-01-24, 12:17 PM by Bino.)
First, add this javascript function:
PHP Code:
function gencode()
text "";
    for( var 
i=014i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
output text.match(/.{1,14}/g);


Change the 14 to however long you want the code to be.

Then, add this code to your button.

PHP Code:
onclick="javascript:document.getElementById('code').value = gencode();" 

And add this to your input (textbox) tag
PHP Code:

How it works:
The gencode function generates a random string. Then, the document.getElementById finds the element with the ID "code" (which you make your text box) and then changes the value of it (the text within the textbox) to the output of the gencode function.

Hope this helps.

Related Threads
Thread Author Replies Views Last Post
  Where to find content locker code on a pre designed landing page? Holyearnings 3 255 2017-09-13, 06:56 AM
Last Post: Holyearnings
  OGads captcha locker onclick code ? gamertrial1 1 458 2017-08-11, 10:04 AM
Last Post: lovecash
  Decode this .js code roktim 11 707 2017-07-24, 09:27 PM
Last Post: Harrington
  how to youtube verify code phone ? warrensandre25 2 323 2017-07-23, 07:29 AM
Last Post: Padfoot
  [HELP] How Do I Remove Widget Container From The Code blunt 0 360 2017-06-14, 11:35 PM
Last Post: blunt

About Us | Contact Us | CPA Elites | Advertise | Stats

© 2013-2018 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top