S
S
SpeakeazyYT22018-03-26 15:15:04
1C-Bitrix
SpeakeazyYT2, 2018-03-26 15:15:04

How to separately pull out fields from a form, such as feedback on the Bitrix website?

Hello. The link isk.srv1.zitz.ru/services/partnerskaya-programma has a custom form. You need to take the phone field and the Send button from it so that these elements are separate and you can place these components on the main page of isk.srv1.zitz.ru (scroll to the very end until the text "book a tour"). For example, so that instead of the text in the middle "book a tour" (on the main page) there would be a field with the ability to enter a phone number and instead of the "book a tour" button there would be a "Submit" button, like on the form - isk.srv1.zitz.ru/services/ partnerskaya-programma
How to implement this?!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Nikolaev, 2018-03-26
@gromdron

There are a lot of options - Select it all in a component or, for example, create an include area and display it already. Well, or you already have it and you just need to edit the page .
Or I did not quite understand the question and you want someone to do it for you for free?

B
blayloock012018, 2018-03-26
@blayloock012018

Gotta start somewhere.)

function sendevent() {
  var a = {
    phone: $("#PHONE").val(),
    info: "-"
  };
  $.ajax({
    type: "POST",
    data: a,
    url: "/services/eventsend.php",
    dataType: "html",
    success: function (b) {
      console.log(b)
      // подгружаем изменяем контент
    },
    error: function (b) {
      console.log("Произошла неожиданная ошибка..")
    }
  })
};

And by the way, there is a very good example on the main page, there is already serialization and data transfer from the form
bxajaxid	8a6c8732dc2496264a2f0003084257
AJAX_CALL	Y
sessid	b0cd9905f99901000589e0f0ebed9db
NAME	тест
PHONE	+7 (999) 999-12-34
DATEEX	тест
form_submit	Отправить

You can tweak the html forms and copy it anywhere)
Then, according to your taste, use BX.ajax({ or $.ajax({
It seems that on the main page, the simple function of checking the correctness of the phone is somehow disguised. Is this the difficulty?)
So, what to do to separately pull the fields out of the form? Copy instead of the text in the middle "order a tour" the field with the phone number and in the sendevent () function call the code for checking the correctness of filling in the phone, if necessary.
Issue resolved?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question