I have the following code:
JS:
var flag = 0;
funct(){//makes changes on css
flag=0;}
HTML:
<form onsubmit="if(flag==1)return funct()">
PHP:
if(somethingIsOK){
echo "<script>flag=1;</script>"; //should use new css which comes with funct()
}else{//do something else with keeping the existing css}
I want this structure, but I could not use the variable flag like I wanted to. I have tried making flag static but it did not work.