Calling form function from html template

How can I call a form function from  onclick in a HTML template ?

example:
<ul class="nav navbar-nav navbar-right">
<li><a href="#" onclick="this.Form1.login()"  title=""><i class="glyphicon glyphicon-user"></i>accedi</a></li>
</ul>


I suggest to do it the other way around, it is easier.
From your Pascal code, you add an event listener on the anchor HTML element (give it an ID)

document.getElementbyId(anchorid).addEventListener('click', @yourPascalHandler);

I checked this out added this to a button click


  asm
    var elem = document.getElementById('Clicklink1');
    elem.addEventListener('click', @checkclick);
    /    document.getElementById("Clicklink1").addEventListener("click", @checkclick);/

  end;


The moment I have the seond line ie elem.addEven .... or the 3rd line the web page just hangs and does not load 
I have a click procedure  defined as private

procedure TForm1.checkclick;
begin
  WebLabel4.Caption := 'it works';
end;

Change it to a function 

function TForm1.checkclick:boolean;
begin
  WebLabel4.Caption := 'it works';
  Result := true;
end;
Changed it to public
 Even that hangs. Can you please guide me ?

in the debugger it is identifying the element correctly. 

Why do you use double-quotes for "Clicklink1" ? and "click" ?

The double quotes line is commented. But I tried all combinations before coming back to you.


    document.getElementById("checklink").addEventListener("click", function(){
  document.getElementById("lblheading").innerHTML = "Hello World";

works
I have copied this from w3schools and they are using doublequotes. But singlequote also works.

    document.getElementById('checklink').addEventListener('click',@checkclick);
does not. So the issue is with the way the function is being called is where I am making the mistake

  asm
    var ele = document.getElementById('checklink');
    ele.onclick = (e) => { this.checkclick() };
  end;
This worked

Thanks for informing a solution was found.

When you use
document.getElementbyId(anchorid).addEventListener('click', @yourPascalHandler);
it will of course depend where your Pascal method is declared. If this is a method in a class, it might be this.yourmethod

This has stopped working after the new update 


 asm
    var ele = document.getElementById('menuInpBasic_Meq');
    ele.onclick = (e) => { this.ShowInpBasic_Meq() };

    var ele = document.getElementById('menuInpPanels');
    ele.onclick = (e) => { this.ShowInpPanels() };


Giving the following error
Uncaught TypeError: this.ShowInpBiocide is not a function
    at HTMLAnchorElement.document.getElementById.onclick 

Would appreciate a quick resolution for this because the whole project has stopped


I cannot make sense of this problem report.

You mention you see the error in this.ShowInpBiocide and in your ASM blockk I cannot see anything related to ShowInpBiocide 

ShowInpBiocide is not a function of TMS WEB Core, so it must be somewhere in your code.


No I just put in a small part of the code

  asm
    var ele = document.getElementById('menuInpBasic_Meq');
    ele.onclick = (e) => { this.ShowInpBasic_Meq() };

    var ele = document.getElementById('menuInpPanels');
    ele.onclick = (e) => { this.ShowInpPanels() };

    var ele = document.getElementById('menuInpSolvents');
    ele.onclick = (e) => { this.ShowInpSolvents() };

    var ele = document.getElementById('menuInpBiocide');
    ele.onclick = (e) => { this.ShowInpBiocide() };

    var ele = document.getElementById('menuInpElements');
    ele.onclick = (e) => { this.ShowInpElements() };

    var ele = document.getElementById('menuInpRemarks');
    ele.onclick = (e) => { this.ShowInpRemarks() };

  end;

procedure TFrmMain.ShowInpBiocide;
  procedure AfterCreateDefault(AForm: TObject);
  begin
    { if Assigned(frm) and (frm is TFrmDefault) then
      WebFormResize(nil);
    }
    asm
      /*      var ele = document.getElementById('frmheading');
      ele.innerText='Biocide Testing Input';
      */
    end;
    TfrmInpBiocide(frm).mcustname.SetFocus;
begin
  if Assigned(frm) then
    frm.close;
  begin
    frm := TfrmInpBiocide.CreateNew('mainhost', @AfterCreateDefault);
  end;
end;


This is the full code. Believe me I have shown a demo based on this to my customer and the code was working absolutely fine. Kindly see the previous notes in this thread

I was waiting for the fnc grid issue to get resolved and thanks to Carona I go some breathing space too. So I have not really worked on this issues till today

With just some partial code snippets, I cannot make sense of it.
Please isolate this and prepare a full project sample project with source + step by step info how to reproduce it and email it to support so we can investigate.

I created the demo program as you requested. But found it working there. I went back to my program. Cleared the browser cache, cleaned and compiled again and it worked. 

Ok, thanks for informing