Answer the question
In order to leave comments, you need to log in
How to do form processing in a custom component?
I created my own component that displays a form with a submit button.
<form action="<?php echo $componentPath?>" method="POST">
<input type="submit" name="submit" value="Submit">
</form>
Answer the question
In order to leave comments, you need to log in
what do you give in $componentPath?
you need to contact the same component by sending the form to the same page where the component is called, then you can catch it in class.php simply by checking $_POST, i.e. if the component is called from site.ru/ then we direct it to / , and not to the component folder itself
Take samples of the components from the materials for exam No. 2 and train on them https://academy.1c-bitrix.ru/certification/exams.php
1)
<form class="form" method="POST" Action="<?echo $APPLICATION->GetCurPage()?>"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question