currently I'm trying to make it so that when the user clicks a link it submits the corresponding form via javascript. I used document.getElementById("id").submit() as a basis on how to send the form so my code should act similar to it in my understanding.

Here's the code: 

```
function run(clickedLink){
clickedLink.id.submit();       //I did it like this since document.getElementById just gets the form id and since link and form have similar id's I thought it would send
}

<form id = 'formId'>
<a href = '#' id = 'formId' onclick = run(this)>Link</a>
</form>

```

I tried going with name = 'formId' too but it still doesn't run as I wanted it too.

Note: doing this since this code iterates dynamically and the id gets updated i.e. formID1, formID2...

Better ways to implement this are welcome too