N
N
nikita_falcon2020-08-05 16:42:24
1C-Bitrix
nikita_falcon, 2020-08-05 16:42:24

How to transfer data to the infoblock using a form, on AJAX?

<form class="review-form">
  <input class="input" type="text" placeholder="Your Name">
  <input class="input" type="email" placeholder="Your Email">
  <textarea class="input" placeholder="Your Review"></textarea>
  <div class="input-rating">
    <span>Your Rating: </span>
    <div class="stars">
      <input id="star5" name="rating" value="5" type="radio"><label for="star5"></label>
      <input id="star4" name="rating" value="4" type="radio"><label for="star4"></label>
      <input id="star3" name="rating" value="3" type="radio"><label for="star3"></label>
      <input id="star2" name="rating" value="2" type="radio"><label for="star2"></label>
      <input id="star1" name="rating" value="1" type="radio"><label for="star1"></label>
    </div>
  </div>
  <button class="primary-btn">Submit</button>
  </form>

Information block properties

5f2ab6d784165186273679.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Alexandrov, 2020-08-05
@nikita_falcon

1. Add the action="create_form.php" handler for the form
2. Get the form data in the $_POST array
3. Pass the received values ​​to the keys of the $arLoadProductArray parameters array
4. Then create a new element new CIBlockElement
https://dev.1c-bitrix. en/api_help/iblock/classes/c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question