Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi, in using this code for date form. but the date picker is not appear.

my question is what cause the date picker not to appear?

thank you

What I have tried:

this is my code

<div class="form-group">
                        @Html.Label("Date Maintain")
                        <div class="col-md-10">
                            Html.EditorFor(model => model.Date_maintain, new { htmlAttributes = new { @class = "date-picker form-control", style = "width:60%;" } })
                           
                            @Html.ValidationMessageFor(model => model.Date_maintain, "", new { @class = "text-danger" })
                        </div>
                    </div>


i also use this code line

@Html.EditorFor(model => model.Date_maintain, new { htmlAttributes = new { @class = "date-picker form-control", style = "width:60%;" } })
Posted
Updated 13-Jul-20 21:00pm

1 solution

You can add this to your style attributes -

HTML
Html.EditorFor(model => model.Date_maintain, new { htmlAttributes = new { @class = "date-picker form-control", style = "width:60%; visibility: visible;" } })


visibility: visible; should do the trick.
 
Share this answer
 
Comments
dlnzki 14-Jul-20 3:31am    
it does not work. how do i know the cause of this problem? is it because of bootstrap or what? i tried many solution but still it does not appear
Andre Oosthuizen 14-Jul-20 3:48am    
Are you using other css with this element? Somewhere you have a line that sets it to not visible, meaning that we then need more code. For testing try the same code, just add important -

style = "width:60%; visibility: visible !important;" to see if this helps.
dlnzki 14-Jul-20 3:57am    
i use bootstrap version 3.3.7

and i set it in the layout page like this:


i'm not sure what is mean by other css
Andre Oosthuizen 14-Jul-20 4:07am    
It then means that a js file might not be referenced, some code or attribute is missing, from the code you supplied it is almost impossible to see where the fault can be found. I would suggest you read the bootstrap documentation and go through the list to see that you have covered all of the bases - Bootstrapper-DatePicker

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900