0
SUBMIT, refresh page and JS
The problem is I have form with 4 inputs + input type=âsubmitâ. I need after user click on button âsendâ(submit), the form hidden and appear new block with smt like âall ok, your data was send to usâ (on this page, without relocating) I write small script. document.querySelector('input[type="submit"]').addEventListener('click', function(){ document.querySelector('#success').style.display = 'block'; document.querySelector('#form').style.display = 'none'; }) But because after you click on submit the page is refresh. And my click with âok, info was sendâ appear at 1 sec. and hide then... what should I do? The block #succes must stay at this page and not disappear at all. After user sending correct form.
1 RĂ©ponse
+ 1
void function
read up on it here
https://www.quackit.com/javascript/tutorial/javascript_void_0.cfm