How can I build a link with callback function like this, but without necessity of href:

$form['link']= [
  '#type' => 'link',
  '#ajax' => [
    'callback' => 'myFunctionCallback',
    'method' => 'replace',
    'effect' => 'none',
    'event' => 'click',

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.