Virtual Mechanics: Community Forums and FAQs
Virtual Mechanics: Community Forums and FAQs
Feature Requests
forms with serial number|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Junior Mechanic |
I want add a form on my site which visitors can download and print on their printer. The main feature in my form I want is that each form should have unique serial number. I would be obliged if any one can help me.
|
||
|
Guru 'Power' Mechanic![]() |
If you want something "guaranteed unique", you will probably need a script on your server that bumps a serial number each time the page is downloaded -- like a page hit counter.
If "usually unique" is good enough, then with Javascript you could create a serial number on-the-fly -- based on the visitor computer's date/time (down to a fraction of a second). |
|||
|
|
Junior Mechanic |
"usually unique" can solve my problem can you please help with java script
|
|||
|
Guru 'Power' Mechanic![]() |
This should give you a most impressive serial number!
1. Add a text box to your form, and make it big enough to hold a serial number like "1163995512390" which is the one I just created. 2. From the Form Text Box tab, check the box "Read Only" 3. Also from the Form Text Box tab, note the name of your form (labelled "Form") and the name of the text box (labelled "Name"). You need to include those in the following code: 4. Add this code object to your page (no CSS positioning), and make sure it stays after your form on the page (nearer 'to front')
<script type="text/javascript" language="JavaScript">
function SerialNo() {
var currentDate = new Date()
return currentDate.getTime()
}
document.formMyForm.myTextBox.value=SerialNo()
</script>
5. For formMyForm in the code, substitute the name of your form. For myTextBox substitute the name of your text box. |
|||
|
|
Junior Mechanic |
Thank you very much. This have worked very fine.
|
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|

