auto numbering

Permalink
Does anyone know if there is a way to 'auto number' a form submission please?
I basically need a unique number or code that can be used as reference.

Thanks.

deanhawthornthwaite
 
Gondwana replied on at Permalink Reply
Gondwana
Easiest way could be to use a high-precision timestamp.
deanhawthornthwaite replied on at Permalink Reply
deanhawthornthwaite
thanks for your reply. how would one go about adding a precision time stamp please?
mohamedkhalid replied on at Permalink Reply
@deanhawthornthwaite

Just Create a extra text box in your form and keep it hidden or disable it.
Then You can make use of PHP's unique function and create unique ids and store them in that text box with the help of jquery

For unique id documentation visit
http://php.net/manual/en/function.uniqid.php...

In your form block's view.php write
<?php
$uniq=$uniq=uniqid('RP'); instead of RP use anything you like RP means reports so unique id begins with RP
?>

$(function(){
$("#Unique text box id").css("display","none"); --> to hide unique id textbox
$("#Unique text box id").attr("value","<?php echo $uniq;?>");
})