views:

158

answers:

1

I'm trying to create a form with a few fields in XUL. I failed to find a way to create a numeric box and a datepicker with empty values. Textbox of type number has a default "0" value, I can change the default to different number, but I want the box to remain empty. The same goes for the datepicker element, I must specify a valid date, but I want it to be empty until the user decides to enter the date.

Any suggestions?

A: 

I suspect that everything has to have a default value as a result of usability guidelines, though I can't find any concrete evidence of that in terms of official documentation (the addition of the empty and emptyText attributes in Firefox 3.0 are what led me to this hypothesis). With this in mind, your only options would seem to be either to use a plan textbox, or to pick some defaults. You could always ignore the numeric and date fields if they've not been changed, or perhaps provide an option to enable/disable the fields?

robertc
Thanks for the response, that was what I was worried the answer would be, lots more javascript to code. :-)
LiorH