add hidden inputs in form
This commit is contained in:
25
partials/formhash.php
Executable file
25
partials/formhash.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?$addrhash = adddr_hash();
|
||||
if ($addrhash !== null):?>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
let form = document.getElementById('form-right');
|
||||
let inputAdded = false;
|
||||
|
||||
form.addEventListener('mouseenter', function() {
|
||||
|
||||
if (!inputAdded) {
|
||||
|
||||
var hiddenInput = document.createElement("input");
|
||||
hiddenInput.type = "hidden";
|
||||
hiddenInput.name = "addrhash"; // имя поля
|
||||
hiddenInput.value = "<?=$addrhash?>"; // значение поля
|
||||
|
||||
form.appendChild(hiddenInput);
|
||||
inputAdded = true;
|
||||
|
||||
}
|
||||
}, { once: true });
|
||||
});
|
||||
</script>
|
||||
<?endif;?>
|
||||
Reference in New Issue
Block a user