Answer the question
In order to leave comments, you need to log in
How to write value to value using jQuery or JS?
Hello. Site on Bitrix. I have a feedback form like this:
<form action="/send.php" method="POST" enctype="multipart/form-data" name="form" id="form">
<input type="hidden" name="element" value="<?=$arResult["ID"]?>">
<input type="email" name="email" placeholder="E-mail" value="" required>
<input type="text" name="textarea" placeholder="Текст сообщения" value="">
<input class="submitbutton" name="" type="submit" value="Отправить">
</form>
<script>
$('.form').click(function() {
$('.form').find('input').val('<?=$arResult["ID"]?>');
$('.form').find('element').val('<?=$arResult["ID"]?>');
return false
});
</script>
Answer the question
In order to leave comments, you need to log in
Do you have a static form? Does it just show up on the page or is it made as a popup window?
If it is like a pop-up window, then you can attach a function to the button that is responsible for opening this form. For example, so
And this is the function that you need to write in the file where all the scripts are written.
function test(id){
$("input[name=element]").val(id);
}
$('.form').find('input[name="element"]').val();
like this search by "name"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question