Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/28/2021 in all areas

  1. Essentially it's the same problem you had with your count. The original problem with the count was that you were trying to echo the count before you loaded the data. The new problem is because you're loading the data before you insert the new comment. There are a few ways you could solve the issue. You could simply re-load the data after adding a new comment. You could re-arrange you code to submit the new comment first, then load the data after. You could leave the code as-is, but redirect the user after adding a comment so the page gets reloaded automatically. Typically when submitting data you'd do a redirect as in option #3. That is known as a Post/Redirect/Get process and prevents people re-submitting duplicate data by trying to reload the page after making a submission.
    1 point
  2. If it's just two, it's probably not worth effort to create some generic solution. Just add each call individually. document.getElementById('whatever1').addEventListener('click', function(){ clear_input('button1', 'hello1', 'world1'); }); document.getElementById('whatever2').addEventListener('click', function(){ clear_input('button2', 'hello2', 'world2'); }); If you need a more generic solution you'll need to explain more about the situation, like why the arguments are 'button1', 'hello1', 'world1' to start with.
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.