'Validate mandatory web form fields'

def validate_mandatory(self, doc):

    missing = []
    for f in self.web_form_fields:
        if (f.reqd and (doc.get(f.fieldname) in (None, [], u''))):
            missing.append(f)
    if missing:
        frappe.throw(((_(u'Mandatory    Information    missing:') + u'<br><br>') + u'<br>'.join([u'{0}    ({1})'.format(d.label, d.fieldtype) for d in missing])))
