Wait to enable an "OK" button unitl empty text boxes are filled
3 views (last 30 days)
Show older comments
I enable a panel in a GUI that has several editable text boxes, an OK button, and a CANCEL button. I want to disable the OK button if one or all of the text boxes are empty, and enable it when all the text boxes are not empty. The CANCEL button is always enabled. How would I write code to say, "Wait until the OK or CANCEL buttons are pressed before resuming the GUI code, while keeping OK button disabled if one or all of the text boxes are empty?"
0 Comments
Answers (1)
Paulo Silva
on 12 Jul 2011
You don't say if you are using GUIDE so here are just a few tips, start the GUI with the editboxes all empty and the button disabled (if you want to have something on them by default enable the button), on every one of those editboxes callbacks check if all the boxes have something in them, if true enable the button.
0 Comments
See Also
Categories
Find more on Platform and License in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!