Ancre on ajax formulaire

Hello dear SPIP community,
I am working on a project where I am using a form, which renders a chart and dynamically updates itself on submission via ajax.
Every time the user submits the form, the page jumps back to the beginning of the form (it is quite a long one).
Is there a way to prevent this scrollTop on ajaxReload?
I am embedding the form like this:

<div class="ajax">
<formulaire_custom|>
</div>
  1. Is there a way to disable the scroll-to the top of the form?
  2. Is there a way to provide a custom id/class to scroll to, such that it can be customized?
  3. Is there a way to programmatically enable/disable/alter the ID of the anchor element?

I am asking the last question, because it would be great to disable the scroll-to feature only on certain values changing. I have the code to analyze this, but I don’t understand how to enable/disable this functionality programmatically.

PS: I have also studied this, but I have not been able to answer my question with it:

I also wanted to take the opportunity to thank you for the great work on SPIP, it has been an excellent companion in various projects large and small.

Kind regards

Hello
In forum source code there is [(#BOUTON_ACTION{<:forum:icone_valider_message:>,#URL_ACTION_AUTEUR{instituer_forum,#ID_FORUM-publie,#SELF|ancre_url{forum#ID_FORUM}},'ajax valider noscroll'})]

Have you tried just appending the anchor to the ajaxed url ?

In case it doesnt work properly, try using var_ajax_ancre ajax url argument instead, whose value should be the destination anchor.

Thank you JLuc.

The solution is to simply add class=« noscroll » to the custom button that I made.
On submit of the ajax form, no scrolling is happening. Problem solved.

Add

<button type="submit" name="button_name" value="true" class="noscroll ... ">
    Advanced ⚙
</button>

I found this by inspecting the HTML of the BOUTON_ACTION that you shared. Thanks JLuc.

Kind regards

FYI and for other readers, noscroll is described here Les formulaires CVT de SPIP - SPIP and here #BOUTON_ACTION - SPIP