Form Customization: Best Practices?

Form Customization: Best Practices?

This question is answered

I'm looking to introduce CAPTCHA support on key form pages, such as creating forum posts, registering users and posting comments.  I've seen discussions about this with regard to adding controls directly to the core files (e.g., CreateUser.aspx).  I'd prefer to handle this via widgets, however.  I'd also prefer to avoid forking existing widgets, if possible, since the Velocity script for widgets such as "User - Login and Create" is fairly involved.

Does anyone have any best practices or guidance with regard to creating widgets that can integrate with forms?  E.g., Can widgets participate in form processing, similar to how Subforms worked in Community Server?  I'm not seeing anything, but I want to make sure I'm not missing something.

 

Verified Answer
  • In general, to modify the behavior of a form, in 6.0, the widget must be edited.  There is not a concept of sub-forms in Studio Widgets.

    For the User - Login and Create widget, you'd want to add the CAPTCHA to the form_join_manual.vm file and validate the value (if your CAPTCHA implementation supports server-side validation) in the main content script in the #elseif ($action == 'join_manual') block

All Replies
  • In general, to modify the behavior of a form, in 6.0, the widget must be edited.  There is not a concept of sub-forms in Studio Widgets.

    For the User - Login and Create widget, you'd want to add the CAPTCHA to the form_join_manual.vm file and validate the value (if your CAPTCHA implementation supports server-side validation) in the main content script in the #elseif ($action == 'join_manual') block

  • I am trying to incorporate the ReCaptcha in the User-Login and Create widget.

    I was able to expose the Captcha control on the widget but unable to connect the server side verification successfully. It hides the widget.

    How do you add the server side to the #elseif ($action == 'join_manual') block in the widget or is this not possible?

    Here is what I am implementing:  https://developers.google.com/recaptcha/docs/java

    Thanks!

  • HighRad: Were you able to get the Captcha control to display as part of your widget prior to validation?  If so, what technique were you using?  You shouldn't be able to embed ASP.NET controls (or any other server-side controls) directly into Velocity script, so I'm guessing you're manually implementing the reCaptcha functionality?  If so, you'd likely need to write a custom widget extension so you can call reCaptcha's validation API.

  • Hi All,

    In-line with how Ben described, I have created a version of the registration widget for 6.0 with a CAPTCHA included for people to use.  You can download it and read about how I built it here: blog.building-blocks.com/computer-says-no-a-captcha-for-telligent-community-6-0

    Hope some of you find this useful.

    Adam