473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to generate alpha numeric numbers using java script

Hellp all,
I want to generate the alpha numeric numbers (like : A-0001/0708,S-0010/0708) as soon as the form is loaded. Is it possible using Java Script. And then these generated numbers are stored in Data Base. n it sh not generate the same number again.
Thanks in advance
Aug 31 '07 #1
3 3081
dmjpro
2,476 2GB
Hellp all,
I want to generate the alpha numeric numbers (like : A-0001/0708,S-0010/0708) as soon as the form is loaded. Is it possible using Java Script. And then these generated numbers are stored in Data Base. n it sh not generate the same number again.
Thanks in advance
Welcome to TSDN.
Generate the Alpha Numeric numbers is possible in JavaScript.
But store those data you need to write Server Side Code.
Try some code then come with Code Tags here with specific Code.
And remember one thing don't use Code Words while you post something here.
This is a forum not a Chat Room.
Anyway, Good luck with your try.

Kind regards,
Dmjpro.
Aug 31 '07 #2
acoder
16,027 Expert Mod 8TB
I want to generate the alpha numeric numbers (like : A-0001/0708,S-0010/0708) as soon as the form is loaded. Is it possible using Java Script. And then these generated numbers are stored in Data Base. n it sh not generate the same number again.
This is possible using Javascript, but you want a unique number each time and you wish to store them in a database. For something like this, it would be much better to use a server-side language.
Aug 31 '07 #3
pbmods
5,821 Expert 4TB
Heya, Pragati. Welcome to TSDN!

When you think about it, 'letters' are really just ASCII codes, which are in turn integers.

JavaScript has a Math.random() function that can generate a random number, and then to convert that number into a character, you simply use String.fromCharCode().

The trick is to figure out how to get your random numbers so that you are only creating characters between 0 and Z. Fortunately, there are lots of ASCII charts out there... :)
Aug 31 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: entoone | last post by:
I have a field called pword, whenever someone enters anything but numeric, i.e. mixed alpha with numeric, or even just alpha.. the following error appears. Warning: mysql_numrows(): supplied...
7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
3
by: success_ny | last post by:
Does anyone have a code snippet to compare those values so I can sort the array of alpha-numeric values that include both characters and integers in it? I.e., if we have values like 4236 and...
3
by: John Baker | last post by:
Hi: I have a situation where i have a number, such as "6", in an alphabetic defined field. I need to convert that "alpha" number to a numeric so that I can use it to refer to an ID in a table....
1
by: A Traveler | last post by:
Hello, i am having this problem. The exact error message is: "Unable to generate code for a value of type 'System.Web.UI.Page'. This error occurred while trying to generate the property value for...
33
by: patrick_woflian | last post by:
hey guys, im just writing a basic calculation at the moment, before building on it for an A-Level piece of work. i can add/divide etc... two numbers together yet i am having a major problem with...
28
by: Rob Cowie | last post by:
Hi all, I wish to generate a sequence of the form 'aaa', 'aab', aac'.... 'aba', 'abb', 'abc' etc. all the way to 'zzz'. How would you construct a generator to acheive this? A simple,...
15
by: Orchid | last post by:
Hello, I am looking to generate a unique ID field on MS. Access. The ID is with 10 digits with the combination of 5 Letters from the 26 letters and 5 Numbers from 1 to 9. The letters and numbers...
5
lotus18
by: lotus18 | last post by:
Hello World! I have a sample code here written in vb .net that restricts the textbox to accept only alpha, alphanumeric or numeric characters. Public Enum MyOption Alpha = 1 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.