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.
I basically need a unique number or code that can be used as reference.
Thanks.
Easiest way could be to use a high-precision timestamp.
thanks for your reply. how would one go about adding a precision time stamp please?
@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;?>");
})
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;?>");
})