function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Surender_PatelSurender_Patel 

Lightning:InputField of date type accepting dummy text and saving as null.

Hi All,

We have a Lightning:InputField of date type. It's accepting dummy text like 'asdf' and saving as null to database. 

How can I prevent user to enter dummy text rather than a proper date?
SandhyaSandhya (Salesforce Developers) 
Hi,

Try to use <lightning:input type="date">

Best Regards,
Sandhya
mukesh guptamukesh gupta
Hi,

Please use 
<lightning:input aura:id="startDate" type="date" label="Start" name="startDate"/>

if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh