Stuck-up with Frappe.throw

Hi Everyone,

I have written a workflow for the Item, and by using that I want to stop users to make any changes if the item is under approval. Below is my code for the same, all is working fine but problem is once user receive the message “You cannot make changes to this item.” after this message the entire form get stuck-up and save button get grayed.

frappe.ui.form.on("Item", "validate", function(frm) {

  if (frm.old_state=="Approval" && frm.doc.workflow_state=="Approval")
    {
      if (user_roles!="Item Manager")
         {  
           frappe.throw("You cannot makes changes to this item.");
              
         }
    }
});

I appreciate if anyone can help me to resolve this issue.

Instead of frappe.throw, you can try following:

frappe.msgprint();
validated=false;