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 Odpowiedź
+ 1
void function
read up on it here
https://www.quackit.com/javascript/tutorial/javascript_void_0.cfm