Webform validation are working but they some error
This line:

if($form_id)


is doing nothing. Form ID is never something that will be considered FALSE. PHP Manual says:


  When converting to boolean, the following values are considered FALSE:
  
  
  the boolean FALSE itself
  the integer 0 (zero)
  the float 0.0 (zero)
  the empty string, and the string "0"
  an array with zero elements
  an object with zero member variables (PHP 4 only)
  the special type NULL (including unset variables)
  SimpleXML objects created from empty tags
  


Form ID is a string, name of a function really, and as such can never be empty or "0".

This means your function always enters the code block under if, and appends your validator to all forms. Most forms does not have submitted index defined, hence warning.

You probably wanted something like

if($form_id == 'some_form_ID_you_know_and_I_do_not')


and in validator something like

if( isset($form_state['values']['submitted']) and !empty($form_state['values']['submitted']['title']) ){