Okay
  Public Ticket #877014
Checkbox with hidden text input
Closed

Comments

  •  2
    Ketan started the conversation

    Hello,

    Thanks for the wonderful Angular template. I have a need to have an input box appear below the checkbox when it is clicked. Would you be able to help with ideas on how to do it with Angular? Also, for the masked-input plug-in, is there a reference for regx for fields. I'm trying to display a symbol in the mask like: "_ft/__inches" or "__%". The text 'ft', 'inches', '%' need to be automatically displayed in the field.

    Thanks,

    _K

  • [deleted] replied

    Hi Ketan,

    Thanks for your kind words.

    If you want to show a custom DIV or field when a checkbox is filled, here is an example with ng-model and ng-show:

    <div ng-app>
    <div >
    <input type="checkbox" ng-true-value="A" ng-false-value="B" ng-model="check"/>
    </div>

    <div ng-show="check == 'A'">
    Checked, add your (show/hide contents here)
    </div>
    </div>
    As for masked input, simply execute this in controller when the desired input field is shown:
    $('#ft').mask('???0\'0?0"',{placeholder:'0\'0"'}); // For inches
    

    Simply add ???0 for number with 3 digits and you can apply your desired prefix or postfix.