Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[#1090]

  • Loading branch information...
commit 0fafc9144a04b69d73533b390175d52bbe9effc6 1 parent 1120b92
@pepite pepite authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 framework/src/play/templates/FastTags.java
View
5 framework/src/play/templates/FastTags.java
@@ -118,13 +118,16 @@ public static void _form(Map<?, ?> args, Closure body, PrintWriter out, Executab
if (args.containsKey("name")) {
name = args.get("name").toString();
}
+ String id = args.containsKey("id") ? " id=\"" + args.get("id") + "\"" : "";
+ String clz = args.containsKey("class") ? " class=\"" + args.get("class") + "\"" : "";
+
if (!("GET".equals(actionDef.method) || "POST".equals(actionDef.method))) {
String separator = actionDef.url.indexOf('?') != -1 ? "&" : "?";
actionDef.url += separator + "x-http-method-override=" + actionDef.method.toUpperCase();
actionDef.method = "POST";
}
String encoding = Http.Response.current().encoding;
- out.print("<form action=\"" + actionDef.url + "\" method=\"" + actionDef.method.toLowerCase() + "\" accept-charset=\""+encoding+"\" enctype=\"" + enctype + "\" " + serialize(args, "action", "method", "accept-charset", "enctype") + (name != null?"name=\"" + name + "\"":"") + ">");
+ out.print("<form action=\"" + actionDef.url + "\" method=\"" + actionDef.method.toLowerCase() + "\" accept-charset=\""+encoding+"\" enctype=\"" + enctype + "\" " + serialize(args, "action", "method", "accept-charset", "enctype") + (name != null?"name=\"" + name + "\"":"") + id + clz + ">");
if (!("GET".equals(actionDef.method))) {
_authenticityToken(args, body, out, template, fromLine);
}
Please sign in to comment.
Something went wrong with that request. Please try again.