0

right now from my code, I am able to select a date & time from the drop-down and able to edit by taking inputs from the user.

But I want to force the user to select only from the dropdown rather entering any inputs in that specific field.

Here is the code I used for the date and time picker drop down So If you see the UI I want the user to select only from the drop down. I don't want the user to give any own inputs

1

2

Any help will be appreciated...

3
  • 1
    You mention your code, but you seem to have forgotten to actually include it. Commented Jul 25, 2017 at 22:35
  • 2
    The picture of your code is unreadable. Commented Jul 25, 2017 at 22:39
  • 2
    Hint: if you don't want a user to make a field input-able, then don't make it an input field. Commented Jul 26, 2017 at 0:03

1 Answer 1

1

angular.module("app",['ui.bootstrap.datetimepicker'])
<link href="//unpkg.com/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
<link href="//unpkg.com/angular-bootstrap-datetimepicker/src/css/datetimepicker.css" rel="stylesheet" />
<script src="//unpkg.com/jquery"></script>
<script src="//unpkg.com/moment/moment.js"></script>
<script src="//unpkg.com/bootstrap/dist/js/bootstrap.js"></script>
<script src="//unpkg.com/angular/angular.js"></script>
<script src="//unpkg.com/angular-bootstrap-datetimepicker/src/js/datetimepicker.js"></script>
<script src="//unpkg.com/angular-bootstrap-datetimepicker/src/js/datetimepicker.templates.js"></script>

<body ng-app="app">
  <h3>Datepicker DEMO</h3>
  <p>Selected date: {{data.date | date : 'medium'}}</p>
  <button class="dropdown dropdown1-parent">
    <a class="dropdown-toggle" id="dropdown1" 
       role="button" data-toggle="dropdown" 
       data-target=".dropdown1-parent" href="#">
        Pick Date&nbsp;<i class="glyphicon glyphicon-calendar"></i>
    </a>
    <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
        <datetimepicker data-ng-model="data.date"
            data-datetimepicker-config="{ dropdownSelector: '.dropdown-toggle' }">
        </datetimepicker>
    </ul>
  </button>
</body>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.