diff --git a/context.go b/context.go index 532152ee..5daef37b 100644 --- a/context.go +++ b/context.go @@ -200,6 +200,13 @@ func (c *Context) PostForm(key string) string { return value } +// PostFormExists returns `true` if field with given name exists in the form +func (c *Context) PostFormExists(key string) (exists bool) { + _, exists = c.postForm(key) + + return exists +} + // Param is a shortcut for c.Params.ByName(key) func (c *Context) Param(key string) string { return c.Params.ByName(key)