XenDate Question

KozmoK

Active member
#1
I have a template that is a xen date field. As it is now, if I try to submit the form it barks at me that it needs a positive value.

PHP:
        <xen:comment>
        <dl class="ctrlUnit">
            <dt><label for="ctrl_host_rtudate">{xen:phrase host_rtudate}:</label></dt>
            <dd><input type="date" name="host_rtudate" class="textCtrl" value="{xen:if $record.host_entry_id, {xen:date $record.host_rtudate, picker}, {xen:date $now, picker}}" /></dd>
        </dl>
        </xen:comment>
I commented it out, because its not allowing 0 (empty) when saving. If I comment it out, it saves.

What I would like is the field to be allowed blank, zero value.

Optimally, I would like the field to be a text field with no date picker - and have a button/link with optionally datepicker for that field if the user wants it.

Thanks for your guys help!

Koz
 

KozmoK

Active member
#2
Bump! I believe this might be a bug in the date picker. There is no other validation going on with my form. If I remove the value="" - it saves null/zero values.
 

Mike

XenForo developer
Staff member
#3
A simplified test case of the rendered HTML and a screenshot of the issue would be helpful, as the core code uses input[type=date] with empty values without issue (see user search).
 
Top