I am trying to get data from input generated by math.random to php by
Java Script
id = Math.floor(Math.random() * 100000);
document.getElementById('uid').value = id; // pastes it in input values
<div class="col-md-4">
<label for="validationCustomUsername" class="form-label">
ID
</label>
<div class="input-group has-validation">
<input value="rr" type="text" disabled class="form-control" placeholder="auto generated" name="uid" id="uid" aria-describedby="inputGroupPrepend">
<div class="invalid-feedback">
Please choose a username.
</div>
</div>
</div>
<script>randomized()</script> // function right after input
$uid = $_POST['uid'];
echo $uid;
The data does shows up in the input text area but not when i echo with php
the script does not breaks (php stops working after error) since i tested echoing another variable after it and it shows up on page
I tried print_r() as well as submit button but no hope.
The javascript is executed infact before php code.
what i thought was that it would echo the uid without nay problems but i think the javascript is loaded after php or something for it to stop working but that should not be the case since html follows left to right rule
6