Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Enable/Disable Button

3006086Sep 25 2018 — edited Sep 25 2018

I have 3 elements on my screen.

1. oj-input-text

2. oj-text-area

3. oj-button

I want to enable the button only when both inputText and textArea have some value not otherwise.

One way to do is, i subscribe to the observable corresponding to both these fields.

inputText.subscribe () {

//check if inputText and textArea both have value, then enable button

}

textArea.subscribe () {

//check if inputText and textArea both have value, then enable button

}

But for this to work, i should loose focus from that element, only then the subscribe works.

Is there any other elegant way to do this? Where in, as soon as i type into the text-box/area without loosing focus, i should be able to have a check?

Comments
Post Details
Added on Sep 25 2018
2 comments
973 views