its me
its me

Reputation: 542

How to avoid keypad for particular input field?

I have created an ionic mobile app and if the user presses any input field the keypad opens; that's working fine. I have one datepicker with input field where I need to hide the keypad. How can I do this?

<div class="col">
    <label class="item item-input item-stacked-label">
        <span class="input-label">Date</span>
        <input type="text" ng-model="bookdate" name="bookdate" id="txtstartdate" required="">
    </label>
    <div class="form-error" ng-messages="projectForm.bookdate.$error">
        <div class="form-error" ng-message="required">* Mandatory</div>
    </div>
    <script type="text/javascript">
    $(document).ready(function() {

        $("#txtstartdate").datepicker({
            minDate: 3,
            maxDate: "+8M"
        });

    });
    </script>
</div>

Upvotes: 0

Views: 50

Answers (2)

Milap Jethwa
Milap Jethwa

Reputation: 481

Use date piker plugin for ionic.

http://market.ionic.io/plugins/ionicdatepicker

Upvotes: 1

Ajinder Singh
Ajinder Singh

Reputation: 530

Add readonly to the date input

 <input type="text" ng-model="bookdate" name="bookdate" id="txtstartdate" required="" readonly="readonly">

Upvotes: 1

Related Questions