Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank Date Picker

Status
Not open for further replies.

MJV57

Programmer
Apr 18, 2009
87
CA
I have a form with a datepicker conected to a database. I would like a blank to show up when no date has been saved in the data base for the datepicker field. Can anyone help me with this. I always endup with the current date showing up in the datepicker field when the database has a null value for the date field.
 
why you just don't hide the datepicker?
add a checkbox to, when checked, enable the user to make the control visible.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Many fields to change and this would take too long
 
Maybe you can subclass the dateTimePicker control and override/extend the way it handles null values?
 
I don't think that the datetimepicker control can have a null or no value within it, hence why it is showing the current date if the value is null...

Regards,

Martin

Computing Design And Services:
 
There is at least one third party control that I believe will do what you are looking for. We use a version of it for Windows forms. It is called "CalendarCombo" and is sold by Janus Systems (janusys.com).

It looks a lot like the Microsoft DateTimePicker, but it has a "Today" and a "Null" button, both with configurable text.

We allow some of our dates to be nullable through its .Nullable property.

We display the "Null" button (although you can also hide it) through its .ShowNullButton property.

And we change the "Null" button's text to "Blank" (which we feel is more user friendly) through its .NullButtonText property.

Keyboard users can also blank the date out by pressing the delete key while the control has focus. If I remember correctly, that was built-in. If not, it is an easy feature to add.

There may be others on the market as well. This is one that we have used that has worked well for our purposes (which sounded similar to your question).

BlackburnKL
 

I created a User Form, where one of the fields is "Date of Birth"; I used the XML "DatePicker" data-field for this attribute.After inputing the information, I "SAVE" it.

The problem is : when I VIEW the page (re-load it in my browser), the date-of-birth disappears. It isn't SAVED, for some reason.Every other field is stored.

But, the date of birth vanishes.

Is there something else that I ought to do with the "DatePicker", to ensure that it is saved in my system's repository?


Here is the code I am using :


<Field name='global.dateofbirth'>
<Display class='DatePicker'>

<Property name='required' value='true'/> <Property name='title' value='Date of Birth'/> <Property name='multiField' value='true/>

</Display>
</Field>
 
Actually you will probably find your date is saved if you check your database but the datepicker comes up with a default date.
 
Not sure I understand how this helps.

Yes, I'm aware that the date itself is probably saved in the database. What I need to know is how to make sure it shows up on the VIEW page
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top