Validate the dialogue on the OK button or enter key

I have a dialog box with a group of checkboxes and buttons OK and cancel. When the user clicks OK or presses ENTER, I want to post other orders and keep the dialogue open if none of the boxes checked. I know how to test the boxes, but I don't know how to do this with an event handler and keep the dialog box open. Any suggestions or pointers would be appreciated.

Rick

Here's a way to do

var w = new Window('dialog');
var chk1 = w.add('checkbox', undefined, 'check 1');
var chk2 = w.add('checkbox', undefined, 'check 2');

var btnOk = w.add('button', undefined, 'ok');
var btnCancel = w.add('button', undefined, 'cancel');

btnOk.onClick = function () {
          //alert('click');
          checked ();
}

btnCancel.onClick = function () {
          //alert('cancel');
          checked ();
}

w.show();

function checked () {
          if (chk1.value || chk2.value)
                              alert('checked');
          else
                    alert('unchecked');
}

Tags: InDesign

Similar Questions

  • macOS Sierra - press and hold the power button to enter the mode 'sleep'

    I recently updated my MacBook Air (13 inch, early 2015) model of El Capitan macOS Sierra 10.12. Before the update, hold down the power button / stop for 2-3 seconds, put the machine in standby mode. It does not properly after the update. Release the power button to switch to sleep mode works only once after each time you start the machine.

    I know he has an option to set the mode of sleep using Ctrl + button / stop and by selecting one of three options to restart, sleep and Shutdown, but who needs 3 more click click and is not fast. Also, independently of any application that is open, pressing the button walk / stop worked fine before the update, but now I need to be on the desktop even do Ctrl + Power button work.

    All patches available for it? Miss me the old way of put my Mac to sleep I do not remember if I did some tweak in my Mac, or was it a default feature...

    Greetings jainam2209,

    Thank you for using communities of Apple Support. It seems you want to put the Mac to sleep, but it does not always work.
    I would recommend read you these articles, the first article explains the ways that macOS Sierra is supposed to go to sleep.
    The second article can help if the computer won't sleep when you're trying to sleep.

    macOS Sierra: put your Mac to sleep

    macOS Sierra: If your Mac won't go or stay asleep

    Take care.

  • Why did I not click on the lock button to enter in wondows, I never used to have to do this

    After I turn on the computer and using it for a while and let the screen goes black and then when I click that it lights up, the lock button is there.  When I came to my computer, it has not done this.  In other words, when I left the computer, the windows icon would remain, and the screen would not go dark. How can I get rid of this lock?

    Hello

    Control Panel - Power Option - on the left upper part require a password on WakeUp-
    the value requires a password.

    Make right click Desktop - Screen Saver - uncheck on summary, logon screen.

    I hope this helps.

  • Captivate 9 - text entry area - cannot navigate through the input of text boxes on the same slide using enter key (works only tab)

    I designed a slide that has 3 areas of text entry.

    I need the user to be able to type in their response to the first box and then press the ENTER key, it will pass them in the next text box. After typing in their response to the second box, press ENTER, and then have developed pass to the third area.

    I don't want to use tab, I want to go to work as a shortcut key, so this works well on all devices. It feels like a trip to the logic of the user.

    I removed the button SUBMIT and check the validate user input.

    I put the shortcut key to ENTER in propriety / Actions area

    However, after that type in an answer and pressing on enter, the focus is not moved in the input text box available at the following address on the same blade.

    This happens regardless of browser (tested Firefox, Chrome, Safari, and IE9/10) and also OS - Windows 7, Mac OSX 10.9, 10.10 and latest version of iOS

    Only the tab key works (Ive even tried with other keyboard shortcuts and it always comes back to TAB).

    I know that this feature is possible in Captivate 9. I have read and watched many tutorials online, it seems a very basic feature. I could be wrong.

    This is a feature of wholesale/known or I'm doing something wrong.

    If a bug, is there a plan to fix it soon?

    Indeed, your problem is related to the Enter key as a shortcut key, not to have multiple TEB and one absolutely validation button. Take a look at this article very old (you are not the first to ask about this):

    A submit button for multiple text entry boxes? -Captivate Blog

    But here I explained to indicate to the user click in a next TEB, do not use input.

  • Question: The Horizontal text tool enter key returns to the same line

    Hello

    This is my first post on this forum, and join me this Community aims to ask for help whenever I'm stuck all by learning Photoshop CS6 extended.

    I have been unable to find solution to this little problem... When you use the horizontal type tool I press ENTER key, the cursor returns to the same line and again write the previously written text. I did not have this problem while doing the same thing before, so I think I messed up a few parameters. Help, please.

    Also let me know how to set up Photoshop to its default settings, I mess up something else.

    Thank you.

    Your leader is off. Set it to automatic.

  • IPhoto crashes when you press the info button

    Since very recently, IPhoto crashes every time when I press the info button to enter people information a photo. I have version 9.4.3. running on OSX version 10.8.5. I added the first lines of pages and the pages or error report, if that can help anyone. I tried to repair the basis data, but without success. I am very grateful for any advice on this issue.

    Process: iPhoto [552]

    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto

    ID: com.apple.iPhoto

    Version: 9.4.3 (9.4.3)

    Generation information: iPhotoProject-720091000000000 ~ 1

    App item ID: 408981381

    The external application ID: 15017489

    Code type: X 86 (native)

    Parent process: launchd [139]

    User ID: 501

    Date/time: 19:50:47.475 2016-01-04 + 0100

    OS version: Mac OS X 10.8.5 (12F2560)

    Report Version: 10

    Interval since last report: 34492 sec

    Crashes since last report: 3

    Per-App interval since last report: 905 sec

    Per-App crashes since last report: 3

    Anonymous UUID: 23235B01-625D-2A47-6A8F-352C3092B10A

    Crashed thread: 0 dispatch queue: com.apple.main - wire

    Exception type: EXC_BAD_ACCESS (SIGSEGV)

    Exception codes: KERN_INVALID_ADDRESS at 0x00000000c53b6a10

    If you use iPhoto 9.4.5 or an earlier version, iPhoto will crash whenever you try to use maps. It is no longer supported.

    See:

    The first versions of iPhoto 11 started to plant for many users suddenly last month.

    There is a problem with the functionality of the site, because Google maps will no longer be supported.

    See the solution of Huxly647:

    Huxly647 , November 20, 2015 12:05 AM
    Re: iPhoto crashes after opening several times in reply to carvermon Useful

    I found a solution that works for me...

    1 goto /Applications/iPhoto.app/Contents/Resources

    2 delete the files 'googlemap.html' and googlesearch.html

    IPhoto no longer crashes, site does not work, but it doesn't bother me too much.

    Let me know if it works for you guys...

    Deletes two files "googlemap.html" and the googlesearch.html of iPhoto application bundle prevents the JavaScript running inside and causing the accident.  Log of course do the same thing. So it's pretty clear that something happened at the end of Google.

    To access the files inside the iPhoto application select it in the Finder and ctrl-click on it. Then use the command "Show Package Contents" from the menu.  Open the content subfolder and then resources.

    Do not try this fix without making a copy of the iPhoto application before trying to delete the two files of the entire application.

  • How to complete the action of the OK"" button.

    Hi all

    I am very new to LabVIEW and am not aware of a lot of simple things. Here's what I want to do...

    I want to change a complex VI (not written by me) and want to do a few simple things. There are several entries in my VI:

    (1) constant integers (take for example as "we LED time in seconds")

    (2) OK button (lock type) who starts to things (for example, switches on the LED and LED remain lit for the specified time.

    So, whenever one must press the OK button after entering the duration of start-up!

    Now, I would like to make a small update where I wish to enter a sequence (table 1 d) of the running time, which is good, but how to create a table of switching action OK?
    In my understanding of the OK switch is Boolean type Latch signal and I do not know how to escape manual several clicks on the OK button by some smart changes.

    Any support here will be very appreciable.

    NB. to give a better picture, I tried to create the VI for example virtual LED that I described above, but I have no measurable. Maybe I'm trying to jupm too fast

    You can only run your table in a loop FOR with just a simple press OK.  I hope that your help subVIs you don't have to duplicate the code.

  • By pressing the ENTER key once instead of twice

    Hello!

    I am developing a Login System. I want the user to choose a user name (from the list), and then enter a password (in a text box with "the password display" enabled). I want the user to be able to press ENTER, optionally with a click on the Login button after entering the password.

    I'm doing it with a Structure to the event read the key Down event and using the node Vcle to record key is pressed. (see image below)

    My problem is that the user must press the Enter key twice to something happened. I want that happens on the first click.

    Anyone has any advice?

    Hey PeterPoPS,

    If you right click on the button enter and go to Properties > Navigation key, you can select the toggle property to bind to the key back from there. You can implement the correct mechanical action so that the button is not fixed in this State, such as lock to exit. You can change the action type mechanical button responds with by right-clicking on the control of entry button and navigate through the menu of mechanical Action . If you later want to use this button within a structure of the event, be careful because the mechanical action of locking must be explicitly read and reset through the event.

    This way you can build an event around the change in value of enter key.

    I hope this helps!

    Kind regards

  • Click on the Enter key

    Hello

    What would be the best way to implement "Click button" help "Enter Key" for all buttons in a form?

    Thank you

    AS

    You can use a global listener like the example below:

            private function btn_keyDown(event:KeyboardEvent):void
            {
                    if (event.keyCode == Keyboard.ENTER)
                        if (event.currentTarget is Button) // make sure it came from a button
                            Button(event.currentTarget).dispatchEvent(new MouseEvent(MouseEvent.CLICK));
            }
    
  • Is it possible to make the Enter key on my Mac keyboard function as a tab to complete the forms online faster?

    On some web forms, it would be great to be able to use the number pad with enter key to enter numbers on a website with one hand while keeping the place on my paper with others. It's the only thing that slows me down left on my Mac.

    Thanks for the email. Turns out that the assigned form designer a lot of values in double taborder (10, 10, -1, 10, 10, -1), then the script was confused trying to find the next Higher taborder.

    This revised version is just going in the order rather than trying to find the next box logically. I name this is an EnterInFormN for 'natural order' to distinguish it from the others.

    javascript:(function(){function jfspress(e) {var evt = (e) ? e : window.event; var key = (evt.keyCode) ? evt.keyCode : evt.which; if (key!=13) return true; var target = (evt.target) ? evt.target : evt.srcElement; if (!target.form) return true; var nod = "input|select|textarea"; if (nod.indexOf(target.nodeName.toLowerCase())<0) return true; var inpTypes = "text|file|checkbox|radio|select-one"; if (target.getAttribute("type")) {if (inpTypes.indexOf(target.getAttribute("type").toLowerCase())<0) return true;} else {if (target.className != "enterExits") return true;} var els = target.form.elements; for (var i=0; i<els.length; i++){if (els[i]==target) {if (i==els.length-1) {return true;} else {var eldex = i;break;}}} for (var j=eldex+1; j<els.length; j++){if (els[j].tabIndex!=-1 && els[j].disabled==false && els[j].type!="hidden") {els[j].focus();return false;}} alert("Not handled; eldex="+eldex);return false;} function setup(){var forms = document.getElementsByTagName("FORM"); for (var i=0; i<forms.length; i++){forms[i].onkeypress=jfspress;}} setup();})();

    (code placed in the tags pre - c)

  • How do to navigate to another page when press the 'OK' button to confirm the dialogue?

    Hello
    In a detail of the page, I have a "Delete" button, and when you press this button, it will appear a confirmation dialog box, if the user click on 'Cancel', the dialog box is missing stay and still on the current page, if the user presses the "OK" button, it calls a method in the class ViewImple (do remove and other business process logic) and show a different page. The extract of the JSF page as follows:

    < text af:commandButton = 'Delete' action = 'delete' id = "cb3" >
    < af:showPopupBehavior popupId = "p1" triggerType = 'action' / >
    < / af:commandButton >
    < af:popup childCreation = autoCancel "delayed" = "disabled" id = "p1" contentDelivery = "immediate" >
    < af:dialog id = "d2" type = "okCancel" title = "Confirm deletion?" resize = 'off '.
    dialogListener = "#{scheduleBean.deleteScheduleDialog} ' contentWidth ="200""
    contentHeight = "50" >
    < af:outputText value = "Are you sure you want to delete this report?" id = "ot1" / >
    < af:clientListener type = "dialogue" method = "dialogAction" / >
    < / af:dialog >
    < / af:popup >
    < af:resource type = "javascript" >
    function dialogAction (evt) {}
    result of the var = evt.getOutcome ();
    if(Outcome == AdfDialogEvent.Outcome.Cancel) {}
    evt. Cancel();
    }
    }
    < / af:resource >

    Now the question is when I click on "OK" button confirm dialogue, dialogue is missing, but he can't get into the business logic in ViewImpl class method (the "delete" action value you access method adfc-config.xml file, and then navigate to another page), also click on the button 'Cancel' to stay on the current page.

    All tips will be of great help!

    You can use it as

    Navigate ("deletePage"); the adfc-config. XML

    public static navigate (String taskFlowName) Sub {}

    > FaceContext.getCurrentInstance () .getApplication () .getNavigationHandler () .handleNavigation (FaceContext.getCurrentInstance (), null, taskFlowName);

    }

    or for isnde action to propagate a method you have to use
    > MethodExpression exp =
    > (MethodExpression) ADFUtils.getMethodExpression ("deletePage");
    > getRegAgentNextBtn () .setActionExpression (exp);
    I hope that you ADFUtils with you

  • Not click on the Delete button in Standard OTL OAF page popup warning message

    Hello

    In the page OTL Standard by removing records from its files automatically remove all without showing YES/NO pop messages.

    So, I'm working on this requirement to get messages in context-click on the button.what deletion I did I extend the controller.

    Popup messaging is displayed but when click the Yes button folder is not the deletion.

    Thanks in advance.

    Standard code:

    ============

    ' Public Sub processFormRequest (OAPageContext oapagecontext, OAWebBean oawebbean)

    {

    super.processRequest (oapagecontext, oawebbean);

    DebugUtilities debugutilities = new DebugUtilities (oapagecontext);

    debugutilities.enterMethod (Thi, "processFormRequest");

    String s = oapagecontext.getParameter ("ShowTimecardSearch");

    If (s! = null & & s.equals("Y"))

    {

    oapagecontext.putParameter ("TimecardSearchDone", "Y");

    oapagecontext.redirectImmediately (oapagecontext.getCurrentUrlForRedirect (), true);

    }

    OAApplicationModule oaapplicationmodule = (oawebbean) oapagecontext.getApplicationModule;

    String s1 = (String) oapagecontext.getSessionValue ("TimecardSearchDone");

    String s2 = GlobalUtilities.getStringOrNullFromObject (oapagecontext.getParameter ("event"));

    If (s2! = null & & s2.equals ("DeleteAction"))

    {

    Object obj = null;

    If (s1! = null & & s1.equals("Y"))

    obj = (TimecardSearchVOImpl) oaapplicationmodule.findViewObject ("TimecardSearchVO");

    on the other

    obj = (TimecardsVOImpl) oaapplicationmodule.findViewObject ("TimecardsVO");

    ((OAViewObjectImpl) (obj)) .reset ();

    do

    {

    If (!) () (OAViewObjectImpl) (obj)). hasNext())

    break;

    Line = ((OAViewObjectImpl) (obj)) .next ();

    String s5 = (String) row.getAttribute ("DeleteChecked");

    If (s5! = null & & s5.equals("Y"))

    {

    String s7 = String.valueOf (row.getAttribute ("TimecardId"));

    HXCUtilities.deleteTimecard (oaapplicationmodule, s7);

    Row.Remove ();

    }

    } while (true);

    ((OAViewObjectImpl) (obj)) .setRangeStart (0);

    }

    ======================

    Code modified Contrller:

    ========================

    ' Public Sub processFormRequest (OAPageContext oapagecontext, OAWebBean oawebbean)

    {

    super.processRequest (oapagecontext, oawebbean);

    DebugUtilities debugutilities = new DebugUtilities (oapagecontext);

    debugutilities.enterMethod (Thi, "processFormRequest");

    String s = oapagecontext.getParameter ("ShowTimecardSearch");

    If (s! = null & & s.equals("Y"))

    {

    oapagecontext.putParameter ("TimecardSearchDone", "Y");

    oapagecontext.redirectImmediately (oapagecontext.getCurrentUrlForRedirect (), true);

    }

    OAApplicationModule oaapplicationmodule = (oawebbean) oapagecontext.getApplicationModule;

    String s1 = (String) oapagecontext.getSessionValue ("TimecardSearchDone");

    String s2 = GlobalUtilities.getStringOrNullFromObject (oapagecontext.getParameter ("event"));

    If (s2! = null & & s2.equals ("DeleteAction"))

    {

    oapagecontext.writeDiagnostics (Thi, "Enter in DeleteAction event param maton", 1);

    OAException mainMessage = new OAException ("HXC", "HXC_TCSEARCH_DEL_CONFIRM");

    oapagecontext.writeDiagnostics (Thi, "Enter in DeleteAction event param Manjunath1", 1);

    Note that even if we do our Yes / No button submit a

    form, yet it requires a non-null value in the yes/no constructor

    URL parameters for the buttons to make, so we spend just empty

    Channels for this.

    DialogPage OADialogPage = new OADialogPage (OAException.WARNING,

    mainMessage,

    NULL,

    "",

    "");

    oapagecontext.writeDiagnostics (Thi, "Enter in DeleteAction event param Manjunath2", 1);

    Always use Applications dictionary messages of all the channels you want

    display in your page.  Note that any text you have defined declaratively

    in the wake of the OA is directly translatable.

    String Yes = oapagecontext.getMessage ("AK", "FWK_TBX_T_YES", null);

    String number = oapagecontext.getMessage ("AK", "FWK_TBX_T_NO", null);

    We put this value, so the code that manages this key is

    descriptive.

    dialogPage.setOkButtonItemName ("DeleteYesButton");

    The following configures the Yes / No buttons to several buttons, validate

    and make sure that we handle the form submit the original

    (the summary "employees") of the page so that we can process the 'yes '.

    This controller selection button.

    dialogPage.setOkButtonToPost (true);

    dialogPage.setNoButtonToPost (true);

    dialogPage.setPostToCallingPage (true);

    Now define our yes/no labels instead of the default OK/Cancel.

    dialogPage.setOkButtonLabel (yes);

    dialogPage.setNoButtonLabel (no);

    oapagecontext.redirectToDialogPage (dialogPage);

    } else if (oapagecontext.getParameter ("DeleteYesButton")! = null)

    {

    oapagecontext.writeDiagnostics (Thi, "Enter in event param maton DeleteYesButton", 1);

    Object obj = null;

    If (s1! = null & & s1.equals("Y"))

    obj = (TimecardSearchVOImpl) oaapplicationmodule.findViewObject ("TimecardSearchVO");

    on the other

    obj = (TimecardsVOImpl) oaapplicationmodule.findViewObject ("TimecardsVO");

    ((OAViewObjectImpl) (obj)) .reset ();

    do

    {

    If (!) () (OAViewObjectImpl) (obj)). hasNext())

    break;

    Line = ((OAViewObjectImpl) (obj)) .next ();

    String s5 = (String) row.getAttribute ("DeleteChecked");

    If (s5! = null & & s5.equals("Y"))

    {

    String s7 = String.valueOf (row.getAttribute ("TimecardId"));

    HXCUtilities.deleteTimecard (oaapplicationmodule, s7);

    Row.Remove ();

    }

    } while (true);

    ((OAViewObjectImpl) (obj)) .setRangeStart (0);

    }

    Hello

    It seems that the ViewObject request is get executed once again on his return on the Page of the dialog box.

    Can you please do the following suggested changes and see what happens?

    1. change the processFormRequest. Add the threshold also

    dialogPage.setOkButtonItemName ("DeleteYesButton");

    dialogPage.setNoButtonItemName ("DeleteNoButton");

    2. change the processRequest as below:

    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    {
      if ((oapagecontext.getParameter("DeleteYesButton") == null) && oapagecontext.getParameter("DeleteNoButton") == null)
      {
      // Copy the entire processRequest Code here.
      }
    }
    

    Check out the link for more details below:

    Advice from the Oracle Johny: OAF: OA dialogue Page works not when Diagnostics FND profile is not defined

    Let us know what happens after this change.

    See you soon

    AJ

  • HAB check failed for start / could not validate the boot image

    Hello

    I have neglected my E bike for a few weeks and when I loaded and it fed today, it shows a menu and:

    HAB check failed to start

    could not validate the boot image

    Tried all the menu items and none of them worked. For me, it's very odd behavior, because BONE is not affected since the last Android 5 update, several months ago.

    Are there opportunities for the device?

    If you can't make an external reset via hardware buttons, then your phone will have to service.

  • Event of exit/close application trap on exit/return of the device button

    I developed an application in Sib. I want to intercept the output/closing event of the request so that I can ask the user for the confirmation message.

    It may happen that the user will click the back button on the BB device accidentally. If I don't want it of happen and will show the confirmation message.

    There are a variety of ways that you can incorporate it, but I don't know of a hook that will let do it without changing your code.

    The following suggestions can help you change your code.

    (1) If your application has a home screen, i.e. that it all comes down, then override the close() method and replace with your dialogue.  If the user wants to get out, then call super.close ().

    (2) If you have several places that emit the system.exit(), replace it with a call to your own method of "release manager", that shows the same dialog and emits only the system.exit() if confirmed.

  • How to validate the field "Reason for change" in the commercial indications using JavaScript?

    How to validate the field "reason for change" in the commercial directions Summary tab using JavaScript?

    Current version of PLM4P: v6.1.1.5.2

    Please help me to validate the fields using JavaScript.

    Thank you

    Nefertari

    Developed using some of the Javascript predefined functions that we offer, it's just JavaScript and jQuery.

    But here is an example.

    (Use Internet Explorer F12 developer tools to find the IDS of the fields to work with.)

    $(document).ready(function() { 
    
        if (UI_Ext_isSpecInEditMode && UI_Ext_HasWorkflowBehavior('1005'))
        {
           //normally, we can use jquery to retrieve elements ($('#ifOfInput).val()), but it seems to fail when the id and the name attributes are the same. so we just use javascript document.getElementById instead.
           var reasonForChange = document.getElementById('ctl01$SpecSummaryctl1$ctlCollapsibleContentContainer$ctl00$txtChangeReason')
    
           if (reasonForChange != null) { 
    
                if (reasonForChange.value == null || reasonForChange.value.length == 0) {
                     UI_Ext_MarkFieldAsRequired('ctl01_SpecSummaryctl1_ctlCollapsibleContentContainer_ctl00_lblSpecSummaryReasonforChange');
                     alert('Reason For Change is required');
                }
           }
        }
    }); 
    

    However, not the user registration or workflow specification. If you were to do this, you must remove record them and workflow buttons and links, and this probably isn't the best practice. On the contrary, you would write validation server that would give you this error message if they try to save/workflow. (So most customers do not use Extensions of the user interface for this type of validation).

    Kind regards

    Ron

Maybe you are looking for