def validate_form_on_submit(form):
 return (is_form_submitted() and form.validate())

def validate_form_on_submit ( form ) : return ( is_form_submitted ( ) and form . validate ( ) )
if current method is put or post .