using a text link as an update record trigger
I have a text link on my page which when clicked converts a dynamic table to a PDF and allows the user to download it (using a plugin from DMXZone). However, I also want that text link to update a database record when clicked so that I can pass a value of 1 into the "Downloaded" column and that will then display a tick icon on the page using a Show If so that the user knows they've already downloaded that document. I've also wrapped the link in a form tag. However, I'm not sure how to construct the Update Record behavior since of course the text link doesn't appear in the trigger list in the dialog box. I wondered if I could use another onClick event like document.form1.submit() in conjunction with the PDF-generating one but I'm not sure if I can use two onClick events together - wherever I put it, it stops the PDF generator from working. The existing code is as follows:
<form action="" method="post" name="form1" id="form1">
<p id="download1"> <a href="#" onClick="generateJSON('red','PDF','../ScriptLibrary/udeJSON.php',[true,'arial',12,'#000','#FFF',false,false,'arial',10,'#000000',false,false,'#FFF',0.3,'#FFF',10,true,'P',true,'Document 1','arial',12,'#FFF',false,false,'L','L',true,'<?php echo $row_WADAclients['ClientName']; ?> Document 1',false, ,true,true,'#FFFFFF'])">Download as PDF</a>
</p>
</form>
<?php if ($row_WADAclients['Download1'] == 1) { // Show if column... ?>
<img src="../_images/Check-32.png" alt=""/><strong> completed</strong>
<?php } // Show if column... ?>