Refresh page after clicking button (ok / cancel) Refresh page after clicking button (ok / cancel)
i could use some help. I want the page to refresh when someone clicks 'ok' or 'cancel'
Help is appreciated, thanks alot.
This is the code:
Button
<button class="center" type="submit" style="border: 0; background: transparent">
<img src="Playbutton.png" width="800" height="400" alt="submit" onclick="clicked();" />
</button>
Javascript
<script type="text/javascript">
function clicked() {
if (confirm('You just clicked the button, click ok or cancel to refresh.')) {
yourformelement.submit();
location.reload();
} else {
return false;
}
}
</script>
from Stackoverflow
Comments
Post a Comment