Home > database >  Pressing "try it" button reloads the page
Pressing "try it" button reloads the page

Time:07-18

when I press a try it button at the bottom of my page, it reloads the page and deselects all checkboxes. THe main problem i have with this is that when i select a box and click total, the total will be displayed for a split second, before the page reloads back to a state of nothing being checked. enter image description here

CodePudding user response:

If you want to don't reload the page. so you can use event.preventDefault(); when you use the event prevent function, this function block reloading the page clicking/pressing the "try it" button.

CodePudding user response:

Check type of button in your code. If you want to submit form data then only add <input type="submit"> otherwise use <input type="button">

If checked and it is well, then It would be great to add your code here or screenshot of code.

  •  Tags:  
  • html
  • Related