Disable enter/done on pop up keyboard until event occurs


#1

Is there a way to disable the enter/done button on the pop-up keyboard? I have current validation with a form in place and its working fine. I only want the done/submit/enter button on the keyboard to be disabled until the validation is met.

Does Ionic have a way to do this(no matter if your using Android or iPhone device)?


#2

Can you provide a codepen or plnkr of what you have for code?


#3

I’m using the ui-utils for validation and its working fine. Just need to figure out a way to influence/disable keyboard enter/submit on iPhone device

//In my .html page
  <form name="testForm">
    <span ng-show="testForm.searchNumber.$error.blacklist" style="color:red; margin-left:20%">Please enter a valid number</span>
    <p class="item-input search">
        <input name="searchNumber" ng-model="searchNumber" type="number"
               ui-validate="{blacklist : 'notBlackListed($value)' }" required>
    </p>
</form>

//In my controller
$scope.notBlackListed = function(value) {
	  return (value.length == 5 || value.length == 0);
  };

#4

Well the done/submit on the keyboard will show up because you have the inputs wrapped in a form. The symatics will tell the keyboard to present the submit buttons.

Try remove the form and see if that will help


#5

hmm…By removing the form part, the done/submit did remove. However, the ui-validation stopped working. I may have to use some focus or blur event to check for validation.