Cyber Monday Sale! Save up to 50% off!

Click on Button run Javascript

_Alex_
24 Posts
_Alex_ posted this 03 February 2022
Wishlist

Hi,

can you please add an option to Buttons to run a custom Javascript? Just use the onclick attribute.
Let me select "OnClick" in the button options and then let me add some custom string.

This would avoid using html tags with button code :(

regards
Alex

Hi, can you please add an option to Buttons to run a custom Javascript? Just use the onclick attribute. Let me select "OnClick" in the button options and then let me add some custom string. This would avoid using html tags with button code :( regards Alex
Vote to pay developers attention to this features or issue.
6 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 04 February 2022

Hi, Alexander,

Thank you very much for your suggestion, we will add it to our wishlist. Please let us know if you need our further help!
...................................................
Sincerely,
Paul C.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Alexander, Thank you very much for your suggestion, we will add it to our wishlist. Please let us know if you need our further help! ................................................... Sincerely, Paul C. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
bijomaru78
2 Posts
bijomaru78 posted this 08 May 2024

Hi, any news on bringing this feature in? I guess that's why I can't do a onclick JS as per my issue raised here: https://nicepage.com/questions/509599/implementing-filterable-elements-with-css-and-java

Alex, can you share the 'html tags with button code' workaround please?

Hi, any news on bringing this feature in? I guess that's why I can't do a onclick JS as per my issue raised here: https://nicepage.com/questions/509599/implementing-filterable-elements-with-css-and-java Alex, can you share the 'html tags with button code' workaround please?
Support Team
Support Team posted this 09 May 2024

Hello,

We already answered your topic. If you have any additional questions please ask in your topic or create a new one.
...................................................
Sincerely,
George.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello, We already answered your topic. If you have any additional questions please ask in your topic or create a new one. ................................................... Sincerely, George. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp

Last edited 12 May 2024 by Support Team

bijomaru78
2 Posts
bijomaru78 posted this 09 May 2024

Hi George. I'm not sure what you mean. My thread about this issues hasn't had any responses yet?

https://nicepage.com/questions/509599/implementing-filterable-elements-with-css-and-java

Hi George. I'm not sure what you mean. My thread about this issues hasn't had any responses yet? https://nicepage.com/questions/509599/implementing-filterable-elements-with-css-and-java
Support Team
Support Team posted this 10 May 2024

Hello,

  • Have you tried Nicepage categories already and it has a problem, with the page being refreshed? Or did you try to use blog categories and it happened?
  • Please provide an example, of how you create and where the problem is, where you have a long page and many inputs, many texts, that must not be refreshing.
  • Please provide your wish example, I mean the website where we can see your wish in action, and what you want to filter.
  • Please provide your block, where you added a code, and how you added it, we will check the exported block.

The one thing I cannot set is the On-Click function to work as a call
to the JS function: i.e. onclick="filterSelection('all')"

 <button id="myButton">Click me</button>
    <script>
    document.addEventListener("DOMContentLoaded", function() {
      let myButton = document.getElementById("myButton");
      myButton.setAttribute("onclick", "filterSelection('all')");
    });
</script>

This is a code of how you can do it, Please see the text doc in the attachments. You can delete commented parts in the code.txt
...................................................
Sincerely,
George.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hello, - Have you tried Nicepage categories already and it has a problem, with the page being refreshed? Or did you try to use blog categories and it happened? - Please provide an example, of how you create and where the problem is, where you have a long page and many inputs, many texts, that must not be refreshing. - Please provide your wish example, I mean the website where we can see your wish in action, and what you want to filter. - Please provide your block, where you added a code, and how you added it, we will check the exported block. > The one thing I cannot set is the On-Click function to work as a call > to the JS function: i.e. onclick="filterSelection('all')" <button id="myButton">Click me</button> <script> document.addEventListener("DOMContentLoaded", function() { let myButton = document.getElementById("myButton"); myButton.setAttribute("onclick", "filterSelection('all')"); }); </script> This is a code of how you can do it, Please see the text doc in the attachments. You can delete commented parts in the code.txt ................................................... Sincerely, George. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp

Last edited 12 May 2024 by Support Team

_Alex_
24 Posts
_Alex_ posted this 13 May 2024

Hi George. I'm not sure what you mean. My thread about this issues hasn't had any responses yet?

https://nicepage.com/questions/509599/implementing-filterable-elements-with-css-and-java

Hey, just have a look at the html code that is being generated for buttons. Then you'll know which classes your generator is using. Just copy the code into an html element and apply the onclick attribute with your js function.

It's a workaround. I just hope they add this feature to buttons. I'm sure a lot of people who do some custom coding will highly appreciate it.

Kind regards
Alex

> Hi George. I'm not sure what you mean. My thread about this issues hasn't had any responses yet? > > https://nicepage.com/questions/509599/implementing-filterable-elements-with-css-and-java > Hey, just have a look at the html code that is being generated for buttons. Then you'll know which classes your generator is using. Just copy the code into an html element and apply the onclick attribute with your js function. It's a workaround. I just hope they add this feature to buttons. I'm sure a lot of people who do some custom coding will highly appreciate it. Kind regards Alex
You must log in or register to leave comments