Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Engine
Component: Documentation
Branches:
Some better documentation is needed for using strikeone with HTML forms. I'm not a doc writer, but here's what I recently discovered after having difficulty -- perhaps someone can add it to the docs. At least now it's recorded somewhere.
When creating a custom HTML form and desiring that the strikeone protections automatically be added in order to avoid the confirmation screen, the form tag must include the attribute method="POST"
The important things to note in Foswiki 1.0.7:
- the tag "form" must be in lower case,
- the attribute "method" must be in lower case,
- the value POST must be in upper case, and
- the value POST must be surrounded by either single or double quotes).
[see Foswiki.pm --- where the regex line reads: $text =~ s/(<form[^>]*method=['"]POST['"][^>]*>) -
if you use this formula:
<form action="%SCRIPTURLPATH{save}%/%WEB%/%BASETOPIC%" method="POST">
the validation key and strikeone onSubmit string will automatically be added. If you do not use method="POST" or method='POST' it will not be added.
An additional note for devs -- it might be worthwhile to consider changing the regex line to allow for the following: (I don't know for sure, but I think some/most of these would be required to make things properly HTML compliant)
- the tag "form" to be upper or lower case
- the attribute "method" to be upper or lower case
- the value "POST" to be upper or lower case
- the value "POST" to be surrounded by single, double or no quotation marks.
--
MatthewDent - 23 Dec 2009
FYI the case of the HTML is irrelevant - it's a case insensitive regex, as indicated by the /i suffix.
I updated
HowToIntegrateWithRequestValidation your other point.
--
CrawfordCurrie - 06 Jun 2010