History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: FMNG-17
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dan Hardiker
Reporter: Peter Zylla
Votes: 4
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Confluence Extension: Form Mail NG

Checkbox and Radio Buttons

Created: 24/Jul/07 06:03 PM   Updated: 02/Feb/08 08:11 PM
Component/s: None
Affects Version/s: 1.0.3
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments: None
Image Attachments:

1. screenshot-1.jpg
(223 kb)


 Description  « Hide
Hi,

I am trying to use the mail-input macro with type=checkbox. However, the email I receive contains the names of all checkboxes but no values.

Am I missing something?

Btw: How do radiobuttons work?



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Peter Zylla - 24/Jul/07 06:10 PM
{mail-form:destination=test@test.de}
{mail-input:type=hidden|name=subject|value=PTime-Projektantrag}

{info:title=PTime-Projektantrag}
Dein Name:
{mail-input:type=text|name=Absender|cssStyle=width: 200px\|vtlValue=$\!user.fullName}

Kunde:
{mail-input:type=text|name=Kunde|cssStyle=width: 200px|required=true}

Projektname:
{mail-input:type=text|name=Projektname|cssStyle=width: 200px|required=true}

Projektbeginn:
{mail-input:type=text|name=Projektbeginn|cssStyle=width: 200px|required=true}

Voraussichtl. Projektabschluss:
{mail-input:type=text|name=Projektabschluss|cssStyle=width: 200px|required=true}

Projektmitarbeiter (Name):
{mail-input:type=text|name=Projektmitarbeiter|cssStyle=width: 200px|required=true}

Zugeordnete Tätigkeiten:
{mail-input:type=hidden|name=Tätigkeiten}
{mail-input:type=checkbox|name=02-Beratung} 02-Beratung

Sonstige Bemerkungen:
{mail-textarea:name=Bemerkung\|cssStyle=width: 500px; height: 100px}

{mail-submit:Abschicken}{info}

{mail-success:render=wiki}
{tip:title=Projektantrag wurde erfolgreich versendet.}{mail-success}
{mail-form}

Dan Hardiker - 24/Jul/07 06:12 PM
The checkbox doesn't have a value specified, whatever value is put there will be added to the email if checked.

Peter Zylla - 24/Jul/07 06:14 PM - edited
value=true or false or what for one?

Dan Hardiker - 25/Jul/07 12:05 AM
value=whatever you want to appear in the mail if the checkbox is ticked

Peter Zylla - 25/Jul/07 10:29 AM - edited
Thats how looks our recived Mail.
When i type value=OK or something other and i dont checked the box than stands in the mail OK.
If checked or not the value stands ever in the Mail

Dan Hardiker - 25/Jul/07 07:01 PM
If you have a checkbox called "Fish" with the value "Kipper", you should always see the field "Fish:" in the mail, but if its checked then it should say "Fish: Kipper" but if not it should say "Fish: ".

Peter Zylla - 26/Jul/07 08:02 AM
{mail-input:type=checkbox|name=Test|value=OK} Test

is this right?


Dan Hardiker - 26/Jul/07 09:11 AM
Yes, that is right.

Peter Zylla - 26/Jul/07 09:18 AM
OK because when i check the box or not in the mail always stands OK
When the box is checked stands OK. When the box is not checked in the mail stands OK too.

Brett Francis - 30/Jul/07 05:26 PM - edited
I am experiencing the same issue that Peter is mentioning. No matter what the selection of the checkbox I always receive the "value" in the subsequent email.

example wiki markup:

{panel:title=Access Needs|borderStyle=dotted|width=200px|bgColor=FFFeee|borderColor=ccc}
| {mail-input:type=checkbox|value=true|name=access-Standard|checked=true} Standard Desktop Access |
| {mail-input:type=checkbox|value=true|name=access-5thPrinters} 5th Floor Printers | {mail-input:type=checkbox|value=true|name=access-6thPrinters} 6th Floor Printers |
{panel}

results in an email with:

access-Standard: true
access-5thPrinters: true
access-6thPrinters: true

...regardless of the displayed checkboxes' status.

System Info

System Date	Monday, 30 Jul 2007
System Time	09:27:00
System Favourite Colour	Periwinkle
Java Version	1.5.0_11
Java Vendor	Sun Microsystems Inc.
JVM Version	1.0
JVM Vendor	Sun Microsystems Inc.
JVM Implementation Version	1.5.0_11-b03
Java Runtime	Java(TM) 2 Runtime Environment, Standard Edition
Java VM	Java HotSpot(TM) Server VM
User Name	root
User Timezone	America/Los_Angeles
Operating System	Linux 2.6.9-1.667smp
OS Architecture	i386
Filesystem Encoding	UTF-8

Runtime Information

Database Dialect	net.sf.hibernate.dialect.HSQLDialect
Database Connection URL	jdbc:hsqldb:/data/3rdparty/confluence-2.4.4-std/database/confluencedb
Database Driver Name	org.hsqldb.jdbcDriver
Database Driver Version	1.8
Application Server	Apache Tomcat/5.5.15
Servlet Version	2.4
Confluence Home	/data/3rdparty/confluence-2.4.4-std
Uptime	2 days, 23 hours, 45 minutes, 14 seconds
Confluence Version	2.4.4
Build Number	707

Brett Francis - 29/Aug/07 04:07 PM - edited
Since this issue continues in v1.0.3, I figured I'd copy my public comment/question/issue here in order to have all conversation in a single place.

I can't seem to figure out how to get checkbox inputs to work in the following wiki markup.

{mail-form:destination=~brett.francis}
{mail-input:type=hidden|name=subject|value=New Hire Form}
{mail-success:render=wiki}
{tip:title=New Hire Submitted}Thank you for sending the new hire info, please expect a reply shortly.{tip}
{mail-success}

{section:width=550px}
{column:width=250px}

{panel:title=System Requirements|borderStyle=dotted|width=200px|bgColor=FFFeee|borderColor=ccc}
| {mail-input:type=checkbox|name=pc-LaptopStandard} Standard Laptop | {mail-input:type=checkbox|name=pc-DesktopStandard} Standard Desktop |
| {mail-input:type=checkbox|name=pc-LaptopEngineering} Engineering Laptop | {mail-input:type=checkbox|name=pc-DesktopEngineering} Engineering Desktop |
{panel}

{mail-submit:Send}
{column}
{column:width=325px}

{panel:title=Additional Needs|borderStyle=dotted|width=200px|bgColor=FFFeee|borderColor=ccc}
{mail-textarea:name=additional|cssStyle=width: 325px}
{panel}

{column}
{section}
{mail-form}

Regardless of what I check I never get any values show in the resulting email.

pc-LaptopStandard:
pc-DesktopStandard:
pc-LaptopEngineering:
pc-DesktopEngineering:
additional:

I have also tried changing the wiki markup of the checkboxes as:

{panel:title=System Requirements|borderStyle=dotted|width=200px|bgColor=FFFeee|borderColor=ccc}
| {mail-input:type=checkbox|value=false|name=pc-LaptopStandard} Standard Laptop | {mail-input:type=checkbox|value=false|name=pc-DesktopStandard} Standard Desktop |
| {mail-input:type=checkbox|value=false|name=pc-LaptopEngineering} Engineering Laptop | {mail-input:type=checkbox|value=false|name=pc-DesktopEngineering} Engineering Desktop |
{panel}

...with no luck. Regardless of my selection, I then receive:

pc-LaptopStandard: false
pc-DesktopStandard: false
pc-LaptopEngineering: false
pc-DesktopEngineering: false

Any suggestions or guidance will be appreciated.


Dan Hardiker - 29/Aug/07 04:14 PM
There are two things you need to be aware of:
  1. The value parameter of the {mail-input} macro determines that value of the field. I would suggest that you name the fields PC and have the value as Laptop Standard, Desktop Engineering etc.
  2. There is a known bug where by the selection state is not correctly determined with checkboxes (this may also affect radio buttons).

Brett Francis - 29/Aug/07 04:26 PM
OK I changed my input form to:
{mail-form:destination=~brett.francis}
{mail-input:type=hidden|name=subject|value=New Hire Form}
{mail-success:render=wiki}
{tip:title=New Hire Submitted}Thank you for sending the new hire info, please expect a reply shortly.{tip}
{mail-success}

{section:width=550px}
{column:width=250px}

{panel:title=System Requirements|borderStyle=dotted|width=200px|bgColor=FFFeee|borderColor=ccc}
| {mail-input:type=checkbox|name=pc|value=LaptopStandard} Standard Laptop | {mail-input:type=checkbox|name=pc|value=DesktopStandard} Standard Desktop | 
| {mail-input:type=checkbox|name=pc|value=LaptopEngineering} Engineering Laptop | {mail-input:type=checkbox|name=pc|value=DesktopEngineering} Engineering Desktop |
{panel}

{mail-submit:Send}
{column}
{column:width=325px}

{panel:title=Additional Needs|borderStyle=dotted|width=200px|bgColor=FFFeee|borderColor=ccc}
{mail-textarea:name=additional|cssStyle=width: 325px}
{panel}

{column}
{section}
{mail-form}

...and I still get the same behavior. I checked only the "LaptopStandard" and "DesktopEngineering" and the following email was delivered.

pc: LaptopStandard
pc: DesktopStandard
pc: LaptopEngineering
pc: DesktopEngineering
additional:

What bug number is the one you mention wherein the selection state of checkboxes is not correctly determined?


Dan Hardiker - 29/Aug/07 05:00 PM
Uh, this one?

Brett Francis - 29/Aug/07 05:38 PM
You mentioned in your previous comment item #2 that "There is a known bug where by the selection state..." so, I interpreted that as you referring to another bug.

So, any thoughts about a work-around? Have people had more issues with certain uses of checkboxes?


Dan Hardiker - 29/Aug/07 06:07 PM
There is no known work around, and a fix wont be appearing at least for the next 2 weeks as I am worked to the max.

Brett Francis - 28/Sep/07 04:51 PM
Just checking back in since it has been a month. Any luck resolving this issue?

Patricia Montag - 23/Jan/08 02:23 PM
any progress on this issue? would be great to get this resolved in the next days/weeks. thanks!

Dan Hardiker - 23/Jan/08 04:38 PM
This issue will not be resolved within the next 6 weeks without bespoke work. We have a full schedule of paying and critical work which I can't push back for free plugin development.

We are discussing the possibility of having the work commissioned through our Bespoke Solution and we welcome any other enquiries.


Dan Hardiker - 28/Jan/08 09:35 AM
This will be fixed by a generous commissioner who would like to wrap this into his current batch of work on FMNG (watch out for other issues being fixed for 1.1 too).

Dan Hardiker - 02/Feb/08 05:56 PM
I'm looking at this now.

Dan Hardiker - 02/Feb/08 07:57 PM
The bug was that the submission code wasn't checking to see if a input of type checkbox or radio was checked. It does that now and fits what every other form-mail out there will do (i.e. if it's not checked you wont get a row at all).

Dan Hardiker - 02/Feb/08 08:11 PM
Done!