Generate a form number - Post ID 247046

User 2701178 Photo


Registered User
4 posts

Thank you Eric!! But .... :| it still don't work. Uff..... :_(

1. I create an "magical HTML" element (the selection 'hyperlink, ordered list etc.' isn't important to change?!) in my form, copied the script into it, changed the value from "myfieldname' into '1899' and saved it.

2. I opened the html and saw this:
<div class="fb-item fb-100-item-column" id="item97" style="padding: 0px;">
<div class="fb-html">
<div id="item97_div_0">
<script src="common/libs_js/jquery-1.4.4.min.js"></script> <script type="text/javascript">$(document).ready(function(){
var number = 1 + Math.floor(Math.random() * 999999);
//$("#item97").hide();
$("input[name='1899']").val(number);
});</script>

3. So I changed then in my form in my html element from 'item1' to 'item97' and saved it again.
It looks now like this:
<script src="common/libs_js/jquery-1.4.4.min.js"></script> <script type="text/javascript">$(document).ready(function(){
var number = 1 + Math.floor(Math.random() * 999999);
//$("#item97").hide();
$("input[name='1899']").val(number);
});</script>

4. save, export, upload

But:
1. I can't see anything of my individual number
2. did my number start now with '1899' or '18991' '18992' ?
3. what do I have to put into my confirmation emails that the genereated number will be visible?

User 187934 Photo


Senior Advisor
20,190 posts

You can't have numbers at the beginning of a field name. The number generated will be random. Indexing a number will take some more scripting with php to get the last number stored somewhere.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2701178 Photo


Registered User
4 posts

Ok, then it's not the solution I'm looking for :-/
But anyway thank you so much for your help Eric!!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.