I've been searching through all of the various sources for xPages development and haven't found the answer yet. Either that or I completely missed it. (Which is very likely.)
Does anyone know how I can validate that a Radio Button Group control has a radio button selected before the xPage is submitted?
1. David Leedy09/18/2009 10:15:53 AM
Homepage: http://www.lotusnotebook.com
Mike,
I'm not sure I've tried to validate a Radio Button in XPages yet but I did write a blog post about this once that might help.
{ Link }
2. John Mackey09/18/2009 10:39:45 AM
Homepage: http://www.jmackey.net
You can set the "required" property to true, then you can add an error message control to display the required message to the user.
I use this technique in my survey sample app on my website. If you download it, look at the TakeSurvey xpage.
-John
3. Paul Withers09/18/2009 10:44:11 AM
How do you want to validate your radio button group? There are a variety of options, as I'm starting to blog about ({ Link } I spent over a week trying various things because I had very configurable requirements, and I'm sure I can help you.
The blog also has a link so you can see what I've done to validate radio button groups, using dojo tooltips.
Client-side is one option, but there are server-side options. The solution I use is server-side.
4. Paul Withers09/18/2009 10:50:21 AM
Sorry, the link included the closing bracket: { Link }
I tried the xp:validateRequired validator, but couldn't get it to display the message I wanted to use.
By all means email me - pwithers@intec.co.uk
5. Michael Sobczak09/18/2009 11:24:23 AM
Homepage: http://www.punkdbynotes.com
@1: Hi David, I saw your technique, but it won't work for me because my radio button options are dynamic. I use an @DBLookup to retrieve them from a keywords view.
@2: John, I tried that but the validation was never thrown. Let me try that again. I may have done it wrong.
@3: Paul, I saw your post but your solution looked a bit complex for what I need. My xPages skillset is in its infancy at the moment, so I'm trying to accomplish this the simplest way possible.
All I need to do is verify that the user selected an option in the Radio Button group.
6. Nathan Larkin09/29/2009 01:50:55 PM
@4 - This is a bug. See : { Link }
Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | |||