top_en
Log In
Your Bitrix24
Authorize to enter
your company's Bitrix24.
Log In

Bitrix24Care

Working with CRM web form's code

Rating:
Important! Solutions and methods reviewed in this article require certain skills and knowledge. If you are not sure that you have these skills, it's better not to use these solutions. Or you can delegate this task to your administrator or to the other person having the required skills.

How to add the same web form with _form_inline type to the same page several times?

  1. Add div tag - container to which the form is loaded;
  2. Specify node parameter to pass this element;
  3. Change script tag's id.
<div id="bx24_form_inline_second"></div> <script id="bx24_form_inline_2" data-skip-moving="true"> (function(w,d,u,b) ...... /form_loader.js','b24form'); b24form({"id":"11","lang":"en","sec":"xxxx","type":"inline2", "node": document.getElementById("bx24_form_inline_second")}); </script>

Can I use the web form and a widget with the same web form on the same page?

There is one trick that will let you do that, but you shouldn't overuse it. You can replace the CRM web form's inline type with myinline type and bx24_form_inline with bx24_form_myinline.

<script id="bx24_form_myinline" data-skip-moving="true"> ....... b24form({"id":"8","lang":"ru","sec":"7j8b8z","type":"myinline"}); 

How to pass the values of the fields not shown in the web form?

For example, let's pass my_param1 parameter with my value value.

 b24form("id":"7","lang":"en","sec":"ff1mk2","type":"inline", "presets": {"my_param1": "my value"}) 

Edit the web form. In the Default values section, add a field the hidden data will be saved to. Let's enter %my_param1% as the field value.

Now, when a client completes the web form, there will be a CRM element created with a field with a value passed using the presets parameter.

How to add several "contact info" web forms to the same page?

In node parameter, you need to specify an element CRM web form will be added to.

To do that, add div tag to the page and use its id.

div tag must be before script.

Web form 1:

 <script id="bx24_form_inline" data-skip-moving="true"> (function(w,d,u,b){w['Bitrix24FormObject']=b;w[b] = w[b] || function(){arguments[0].ref=u; (w[b].forms=w[b].forms||[]).push(arguments[0])}; if(w[b]['forms']) return; s=d.createElement('script');r=1*new Date();s.async=1;s.src=u+'?'+r; h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h); })(window,document,'http://example.com/bitrix/js/crm/form_loader.js','b24form'); b24form({"id":"7","lang":"en","sec":"beudci","type":"inline"}); </script> 

Web form 2:

<div id="my_container"></div> <script id="bx24_form_inline" data-skip-moving="true"> (function(w,d,u,b){w['Bitrix24FormObject']=b;w[b] = w[b] || function(){arguments[0].ref=u; (w[b].forms=w[b].forms||[]).push(arguments[0])}; if(w[b]['forms']) return; s=d.createElement('script');r=1*new Date();s.async=1;s.src=u+'?'+r; h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h); })(window,document,'http://cp.ru/bitrix/js/crm/form_loader.js','b24form'); b24form({"id":"6","lang":"en","sec":"ivscxd","type":"inline", "node": document.getElementById('my_container')}); </script>

How to specify web form's fields values in widget's code?

Here's an example of the widget's code with specified web form's fields values:

<script data-skip-moving="true"> (function(w,d,u,b){ s=d.createElement('script');r=1*new Date();s.async=1;s.src=u+'?'+r; h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h); })(window,document,'http://cp.bx/upload/crm/site_button/loader_14_i4bdl2.js'); window.Bitrix24WidgetObject = window.Bitrix24WidgetObject || {}; window.Bitrix24WidgetObject.handlers = { 'form-init': function(form){ form.presets = { 'my_cookie1': 'VALUE', }; } }; 
In this example, you can use %my_cookie1% as a custom tag in web form settings.
This helped Thanks :) This didn't help Sorry :(
Could you please tell us why:
It's not what I'm looking for
It's too complicated

Did not find an answer to your question?

Send your question to the Bitrix24Care team
Access to technical support specialists requires commercial plan subscription and is not available to free account users. Free accounts are limited to self-support resources such as product manuals, helpdesk articles, video tutorials, and free webinars. Technical assistance, training, setup, customization and other value added services can also be purchased directly from local Bitrix24 partners