AppendingStringBuffer buffer = new AppendingStringBuffer("<script>\n");
buffer.append("var rules=new Array();\n");
// Visit all form components and check for validators (and write the
// appropriate Yav rules in the current inlined JavaScript)
form.visitFormComponents(new YavFormComponentVisitor(buffer, form));
// Build the call to the yav.init with the proper form name
buffer.append("function yavInit() {\n");
buffer.append(" yav.init('" + formName + "', rules);\n");
buffer.append("}\n");