Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

If the network connectivity between the end client and Joget server is slower than expected, and the end user clicks on the form submission button before CSRF token is obtained.

In this scenario, the user will hit an error page. In order to mitigate this, add the following script into the userview builder's "Custom Javascript"

Code Block
function checkCSRFEnableSubmit(){
    //check for csrf token before enabling form submit button
    csrfValue = $("input[type=hidden][name=OWASP_CSRFTOKEN]").size();    
    if(csrfValue > 0){
        //enable button
        //check again in next cycle
        setTimeout("checkCSRFEnableSubmit()", 1000);


if ( $("form").size() > 0){

The purpose of the script is to enable submit button in any form only after CSRF Token is obtained.