Set Auto Generate ID to exact 16
This commit is contained in:
@@ -10,7 +10,11 @@
|
|||||||
<%= render 'form', promotion: @promotion %>
|
<%= render 'form', promotion: @promotion %>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$("#promotion_promo_code").val(Math.random().toString(36).slice(5) + Math.random().toString(36).slice(5));
|
var r_id = Math.random().toString(36).slice(5);
|
||||||
|
if(r_id.length > 16){
|
||||||
|
r_id = r_id.substring(0, 15);
|
||||||
|
}
|
||||||
|
$("#promotion_promo_code").val(r_id);
|
||||||
// $( "#fromtime" ).timepicker();
|
// $( "#fromtime" ).timepicker();
|
||||||
// $( "#totime" ).timepicker({ 'scrollDefault': 'now' });
|
// $( "#totime" ).timepicker({ 'scrollDefault': 'now' });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user