Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

onload submit form only once

function submit() {
    if (!sessionStorage.getItem("submitted")) {
        console.log("submitting");
        sessionStorage.setItem("submitted", "true");
        document.getElementById("post").submit();
    } else {
        console.log("already submitted, not repeating");
        sessionStorage.removeItem("submitted");
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: toastr.success 
Javascript :: javascript indentation 
Javascript :: jquery fadeout to fadein 
Javascript :: react build command 
Javascript :: how to get a particular line from a file in nodejs 
Javascript :: object.fromentries 
Javascript :: async useeffect 
Javascript :: how to give height through props 
Javascript :: filter parameters in javascript 
Javascript :: remove duplicates from array in javascript 
Javascript :: javascript ternary operator 
Javascript :: Use parseInt() in the convertToInteger function so it converts a binary number to an integer and returns it. 
Javascript :: js canvas draw image 
Javascript :: args slice discord.js 
Javascript :: comment out in javascript 
Javascript :: jquery detect shift tab 
Javascript :: sort li elements with js 
Javascript :: vue access computed property in data 
Javascript :: website implement jquery in js 
Javascript :: check in node whether the port is working or not 
Javascript :: import card content material ui 
Javascript :: javascript for loop array 
Javascript :: add class with jquery 
Javascript :: require mongoose 
Javascript :: remove all elements of one array from another javascript 
Javascript :: how to export mongodb database to json 
Javascript :: js catch rejected promise 
Javascript :: how to add element in arry in js 
Javascript :: export default react 
Javascript :: jquery append to table 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =