Guest User

Untitled

a guest
Dec 2nd, 2014
229
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $grid["edit_options"]["beforeSubmit"] = "function(post,form){ return validate_form_once(post,form); }";
  2. $grid["add_options"]["beforeSubmit"] = "function(post,form){ return validate_form_once(post,form); }";
  3. $g->set_options($grid);
  4.  
  5. And in HTML script tag:
  6.  
  7. function validate_form_once(post,form)
  8. {
  9.     var str=[];
  10.    
  11.     if (post.contract_Worth > 10)
  12.         str[str.length] = "- Contract Approve Date is required";
  13.        
  14.     str = str.join("<br>");
  15.    
  16.     if (str.length == 0)
  17.         return [true,""];
  18.     else
  19.         return [false,"Check following errors:<br>"+str];
  20. }
RAW Paste Data