print_blank_fields

8 views
Skip to first unread message

winchester

unread,
Nov 4, 2008, 9:02:13 PM11/4/08
to JustHumans
A valuable feature of this script is the collection of form data in
the spreadsheet. However, I am surprised that the columns don't line
up. That is, if a field is left blank, the name and contents of the
next field appears in the column, rather than leave it blank and more
organized.

I found this command <input type="hidden" name="print_blank_fields"
value="1"> for the form page that should work when using nms formmail,
but the spreadsheet results and the form report still will not show
blank fields.

Is there a technique that I'm not aware of that gets the spreadsheet
data lined up nicely?

Alternately, is there a way that the field names can appear as the row
header?

Thanks. I love this script.

winchester

unread,
Nov 5, 2008, 10:12:31 AM11/5/08
to JustHumans
I discovered that text fields <input type="text"> and <textarea>
fields will appear as empty cells in the spreadsheet. This is good.
But if a checkbox, radio button, or select/option list is left blank,
the columns for those names/fields are omitted from the spreadsheet,
and the data will not line up vertically.

My workaround is to always pre-check a radio button entry, so the
visitor MUST fill out something. This may require a "None of the
above" option.
Checkboxes will have to be re-coded as selections with a Yes/No radio
button choice, of course with one of them pre-checked.
Never use a select/option list, use radio buttons instead.

Or, if you must use checkboxes or a select/option list, list it last
in your sort element:
<input type="hidden" name="sort" value="order:alpha, bravo, charlie" /
>

This is a very small price to pay for a terrific free script.

I'd still love to see this designed with the more traditional header
row in the spreadsheet.

Thanks for a great script.

Anders Brownworth

unread,
Nov 5, 2008, 1:08:51 PM11/5/08
to justh...@googlegroups.com
Hey,

As you have found, all field contents will show up, even if blank.

The issue you are seeing with checkboxes not showing up is because the browser doesn't send checkbox fields if they aren't checked. Because the browser doesn't get them, JustHumans can't save them so this is really something to do with the way browsers work in general. You have proposed a good work-around. With the below hack though, this issue may be eliminated for you.

Using a unique set of form field names as row headers in the "download" version of post data is worth developing. This does mean, however, that if you change a field name, you will get a new column. And there will be no way to distinguish between a form field that is returned blank versus a form field that isn't returned. Not a big deal, but worth mentioning. I'll put an option for this on the to-do list. Thanks for the suggestion.

-Anders
--
-Anders
-----------------------------------------------------------
Anders Brownworth
http://www.anders.com/
ande...@gmail.com
Reply all
Reply to author
Forward
0 new messages