Every repository with this icon (
Every repository with this icon (
| Description: | An extension for Radiant CMS that allows you to create 'contact us' and other mail-bound forms. edit |
-
It appears that there is some form validation going on, but how do I display the error messages back to the user?
Thanks,
AJ
Comments
-
Bug in mailer extension: wrong number of arguments
1 comment Created 4 months ago by nicolasconnaultHere is the form I created:
<r:mailer:form>
<legend>Enter your contact information and message.</legend> <table> <tr><td> <r:if_error on='name'><p class="error">Name is required</p></r:if_error> <label for="name">Name</label></td><td><r:text id="name" name='name' required='true'/> </td></tr> <tr><td> <r:if_error on='email'><p class="error">Email is required</p></r:if_error> <label for="email">Email</label></td><td><r:text id="email" name='email' required='true'/> </td></tr> <tr><td> <r:if_error on='message'><p class="error">Message is required</p></r:if_error> <label for="email">Message</label></td><td><r:textarea name='message' required='true'/> </td></tr> <tr><td colspan="2"><input type="submit" value="Send" /></td></tr> </table></r:mailer:form>
Now the "mailer" part:
subject: "Sent from your mailer form"
redirect_to: /contact/thanks
from_field: email
recipients:
- email@gmail.comAnd the "email" part:
from: <r:mailer:get name='name'/>, <r:mailer:get name='email'/>
message:
<r:mailer:get name='message'/>Finally, the stack trace that is printed when I submit an empty form:
/!\ FAILSAFE /!\ Sat Aug 01 10:07:29 +0800 2009 Status: 500 Internal Server Error wrong number of arguments (1 for 2)
/usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rack-cache/lib/rack/cache/metastore.rb:94:in `restore_response' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rack-cache/lib/rack/cache/metastore.rb:94:in `invalidate' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rack-cache/lib/rack/cache/metastore.rb:93:in `map' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rack-cache/lib/rack/cache/metastore.rb:93:in `invalidate' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rack-cache/lib/rack/cache/context.rb:137:in `invalidate' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rack-cache/lib/rack/cache/context.rb:69:in `call!' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rack-cache/lib/rack/cache/context.rb:50:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_controller/rewindable_input.rb:25:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_controller/reloader.rb:9:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_controller/failsafe.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/railties/lib/rails/rack/static.rb:31:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `each' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in `call' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/railties/lib/rails/rack/log_tailer.rb:17:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in `call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61:in `process' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:34:in `run' /usr/lib/ruby/gems/1.8/gems/radiant-0.8.0/vendor/rails/railties/lib/commands/server.rb:111 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' script/server:3Comments
this looks like an error i was getting occasionally with 0.8.0 - see http://groups.google.com/group/radiantcms/browse_thread/thread/366377c9a249362a# for more information and an emergency fix if you're still having trouble with it
-
attribute name with html form element does not validate as strict XHTML
1 comment Created 3 months ago by PlanetMasterIt's not a major issue, but you might want to know this:
Attribute "name" exists, but can not be used for this element.
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type)
Solution is here: http://snippets.dzone.com/posts/show/4073
I took a look at the code, but for me (not a coder) it looked like the name attribute is used all over the code, so I decided to leave it to real coders ;)Comments
nameonformwas "included for backwards compatibility" in html 4.01 and merely deprecated in xhtml 1.0 but was never eliminated nor forbidden. this just sounds like the w3c validator being stupid/useless again. you might want to try http://validator.nu/ for a modern conformance checking experience.i guess someone might interpret "...in XHTML 1.0, the name attribute of [the form element] is formally deprecated, and will be removed in a subsequent version of XHTML" as meaning "get those
nameattributes out of here." except that the "subsequent version of XHTML" they meant was the soon to be defunct xhtml2 and the subsequent version of xhtml looks like it intends to makenameonformconformant once more.hope that clears it up.












The email list would be a good place to ask these questions. http://radiantcms.org/mailing-list/
The documentation should be updated, but you can find the tag for the error message here http://github.com/radiant/radiant-mailer-extension/blob/b661842349b8019d98aac9b50a576541d5f01d13/lib/mailer_tags.rb#L66