Random code
Posted: 2019-08-26 01:56
Hello
I am trying this code to generate random code, but I have a problem. When I open existing record and make change the random code change.
Please how can I edit the code to change only new records, not existing record.
Here the code I am using
function transferts_argent_dv($selectedID, $memberInfo, &$html, &$args){
if(!$SelectedID){
ob_start();
?>
<script>
$j(function(){
$j('#code_transaction').val( parseInt(Math.random() * 100000000) );
})
</script>
<?php
$html .= ob_get_contents();
ob_end_clean();
}
}
Thank you
I am trying this code to generate random code, but I have a problem. When I open existing record and make change the random code change.
Please how can I edit the code to change only new records, not existing record.
Here the code I am using
function transferts_argent_dv($selectedID, $memberInfo, &$html, &$args){
if(!$SelectedID){
ob_start();
?>
<script>
$j(function(){
$j('#code_transaction').val( parseInt(Math.random() * 100000000) );
})
</script>
<?php
$html .= ob_get_contents();
ob_end_clean();
}
}
Thank you