checkboxes (Null vs "unchecked" vs zero length st

General ShopSite user discussion

checkboxes (Null vs "unchecked" vs zero length st

Postby redskys » Fri May 23, 2008 12:12 am

This is one of those things that I thought I understood, then realized that I didn't.

I am loading product data into a file and uploading the file to Shopsite.

There are a number of fields in the product database that are checked (or not) to indicate whether or not a given behavior is desired.

The field definitions in the help area indicate in most instances that these fields should contained the word "checked", or the field should contain a null value.

This is the case in the "Taxable" check box. (see following)

Taxable:

Possible Values:"checked" or null. Setting a null value indicates that ShopSite should not calculate sales tax for this product.



However at least one other field (Display Quantity Pricing?) indicates that the acceptable values for that field are "checked" or "unchecked", as below:

Display Quantity Pricing?

Possible Values:checked (display quantity pricing table), unchecked (do not display quantity pricing table)


Questions:

1) Can the word "unchecked" be used in every case to indicate a negative choice, or must a null value be used, except where "unchecked" is expressly permitted?

2) In the cases where a null value must be used, can a zero length string (e.g. "") be used, or must the field value be null? This is a problem, because, just as nature abhors a vacuum, spreadsheet and database programs do poorly by null fields. They are treated in curious ways, and cannot usually be visually distinguished from a zero length string. (Then there is the problem of setting a field value to null.)

I have always thought that "unchecked" was acceptable in every case. Now, having given it some thought, I am completely befuddled.

I found an earlier thread that was on a similar question, but did not really address the issue.

Any clarification would be appreciated.

Thank you group.
redskys
 
Posts: 10
Joined: Fri Oct 05, 2007 8:53 am

Postby Jim » Fri May 23, 2008 6:20 am

I'm pretty sure that 'null' in this sense means empty, nothing in the field not the value "NULL" which would indicate the end of file in a lot of systems.

I think that in most if not all cases it looks for the value "checked" and if it isn't there then the null or "unchecked" value is used.

You could verify this by doing a product/page download and look at what the value is if the field is check or unchecked in the download file. (If you don't want to do it in your store you could get a ShopSite demo store from ShopSite.com and enter a couple of products in it to test with.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 78 guests

cron