Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49184

Hide OK-Button on Popup as long as Input is empty

$
0
0

@cryt1c wrote:

Hi,

I am trying to create a popup with an input field and two buttons (ok and cancel).
The ok-button should be hidden as long as the input field is empty.
How can I do this? Haven't found an answer yet.
I figured something like this:

<input type="text" id="message" ng-model="data.message" required="required" onkeypress="$scope.showButton()">'

buttons: [
  {text: 'Abbrechen'},
  {
    text: '<b>OK</b>',
    cssClass: 'ok-button',
  }

$scope.showButton = function (){
  if($('#message').empty){
    $('.ok-button').hide();
  }
  else {
    $('.ok-button').show();
  }
}

But it does not work. Every hint is highly appreciated!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>