I added a choice field "IsMainframe". Business unit only want Blank and Yes. How do I incorporate blank in a choice field?
You could use a unicode character that does not print anything. I tried it with U+205F and it seemed to work as expected. To put this character in, open up the charmap (Start->Run->charmap) on your machine, then select a font that has unicode support (I chose calibri), scroll almost to the bottom and find the U+205F. You can then double click the character and it will place it in the textbox below. You can then copy that value and put it in a choice field option and it will appear as blank to the user.
EDIT: Make sure you also put it in as the default value, otherwise you will get three choices (NULL, U+205F, and YES). Also, if you have any existing rows in the list, you will see three choices if the row has a null value currently assigned.
As you can see the test column now appears to have a blank option.
|show 2 more comments|
Take look at second answer (no up votes @MarcelBernards) to this StackOwerflow question:
I was exploring similar possibilities when I stumbled across it. Didn't test it myself but I think it is worthwhile.
There is also alternative: You can use standard Yes/No field and write custom event handler to convert No value of your field to null (eg. on ItemAdding and ItemUpdating). Sure this is overkill but if you really need it...
Just create the Choice field as a drop down list with the only option of Yes and set no default value. When an item is submitted an empty value will be set in the list.
If a user sets the field and wants to revert back to no value, they'll be forced to go into datasheet mode to remove the selection. THe regular editform will not give them a means to deselct the only value in the list.
You could use some jQuery to set it back to empty. Here's a basic example.
You'll probably want to wrap it in some sort of click function or wrapped in logic that checks for a query string value to exist.
Alternatively you could create it as a Yes/No field with the default value being No (unselected). It would save into the list as No, not a blank value though.
|show 3 more comments|