Jump to content

button onclick issue


Recommended Posts

Hi, can anyone help me?  I have been  using the code below  without issue on an Caspio HTML data page, but am having issues when I add it to an HTML block in a report.  

<button class="block" onclick="document.location='https://--myURL--? UniqueProjectID=[@UniqueProjectID]">MY URL</button>

When I add the button to a report, the report seems to automatically activate the update_event (even without this button, or the update button being pressed).   If I change the button's to hyperlinks, that I block up to look like a button, this seems to get round the issue, but really I would like to still use buttons.

Changing responsive or AJAX doesn't solve the issue, and if the change the configure settings to stay on the same page after update,  the page just blinks every second on a continuous refresh 

 

Link to comment
Share on other sites

24 minutes ago, RichM said:

Hi, can anyone help me?  I have been  using the code below  without issue on an Caspio HTML data page, but am having issues when I add it to an HTML block in a report.  

<button class="block" onclick="document.location='https://--myURL--? UniqueProjectID=[@UniqueProjectID]">MY URL</button>

When I add the button to a report, the report seems to automatically activate the update_event (even without this button, or the update button being pressed).   If I change the button's to hyperlinks, that I block up to look like a button, this seems to get round the issue, but really I would like to still use buttons.

Changing responsive or AJAX doesn't solve the issue, and if the change the configure settings to stay on the same page after update,  the page just blinks every second on a continuous refresh 

 

Hi . . I Just found the fix to this, but thought it is worth leaving up incase anyone has had this issue.   I read on the CASPIO JS forum, that on Results pages the html code needs to be in the footer, rather than in an HTML block, or else it will execute for every record.  Since moving my code to the footer, I have had no issues with the buttons - all behaving normally.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...