How to limit OK with a check box

I am new to JavaScript.  I have search the web.  I have been working on this box for 3 days.  I have slapped various code from example to get it this far but I cant seem to accomplish my needed last step. 
I need the Check box to also limit the OK button.  AKA "Confirm"  Whether I need a second alert or some other step I am unsure but basically if they don't check the box the only option I want available to them is the cancel button.  Please Help.  Also if you see anything that suggest a novice mistake please point it out.
var meth0d = {
        initialize: function(dialog) {    // Set a default value for radio button field
            dialog.load({"rd01": true });
            this.hasPick = false;    // Disable radio button field
            dialog.enable({   
                "rd01" : this.hasPick,
                "rd02" : this.hasPick,
                "rd03" : this.hasPick });
        commit:function (dialog) { // called when OK pressed
                var results = dialog.store();
                    if (results["rd01"]) meth0d = "Rolled";
                else if (results["rd02"]) meth0d = "Points";
                else if (results["rd03"]) meth0d = "Manual";
        ckbx: function (dialog) {  // Process the checkbox, Verify method
            this.hasPick = !this.hasPick;
            dialog.enable({
                "rd01" : this.hasPick,
                "rd02" : this.hasPick,
                "rd03" : this.hasPick });
        description:
            name: "Ability Stat Method",
            elements:
                    type: "view",
                    align_children: "align_left",
                    elements:
                            type: "static_text",
                            name: "This form has three methods of determining Ability Stat Rolls. \n\n Roll = A computer generated random roll in accordance with the PHB. \n Points = A non-random method that provides balance between players.\n Manual = Allows you to type in any number between 3 to 18  \n\n Note: The Roll Method tracks how many times the form has been opened or\n reset each day and how many reroll attempts the player has made.", 
                            bold: true,
                            font: "dialog",
                            char_width: 30,
                            height: 140
                            type: "check_box",
                            item_id: "ckbx",
                            name: "I understand."
                            type: "view",
                            align_children: "align_row",
                            elements:
                                    type: "static_text",
                                    name: "Methods: "
                                    type: "radio",
                                    item_id: "rd01",
                                    group_id: "rado",
                                    name: "Rolled"
                                    type: "radio",
                                    item_id: "rd02",
                                    group_id: "rado",
                                    name: "Points",
                                    type: "radio",
                                    item_id: "rd03",
                                    group_id: "rado",
                                    name: "Manual",
                    type: "gap",    //Add a small vertical gap between
                    height: 10      //..radio fields and buttons
                    type: "static_text",
                    name: "Note: Once you click confirm you will have to reset the form to access this menu again.", 
                    bold: false,
                    font: "dialog",
                    char_width: 30,
                    height: 20
                    type: "ok_cancel",
                    ok_name: "Confirm",
                    cancel_name: "Cancel",
var retn = app.execDialog(meth0d);

You need to use the validate function of the Dialog object. It returns a boolean (true/false) that specifies whether the dialog needs to be closed or not (the user can still cancel out of the dialog, of course). So in your case it will be something like this:
validate: function (dialog) {
    var results = dialog.store();
    if (!results["ckbx"]) {
        app.alert("You must tick the \"I Understand\" box.");
        return false;
    return true;

Similar Messages

  • How to validate that only one check box is checked in detail block

    Hi All,
    I am using oracle Forms 10G on windows.
    I need help on how to validate that only one check box is checked in detail block. I have multiple records in the detail block and I have check boxes for each record in the detail block.
    I have a button to select the values from the detail records where the check box is checked. But I want to make sure that only one record is check not more than one.
    How do I validate this on a push button trigger?
    Thanks

    When I've done this kind of thing, I create a Form level variable of TYPE number and then add or subtract to this variable as I check and uncheck the checkboxes. If the value of the variable is 1, then you know that only one checkbox is selected. If the value is greater than 1, then you know the user has selected more than one check box. You could also add code to your When-Checkbox-Changed trigger to test the variable and instruct the user to un-check selected record before selecing a new record.
    With respect to the Form level variable, you can use a GLOBAL, PARAMETER or Program Unit package specification. I prefer to use the PU Package Spec as this method has a smaller memory footprint. For example, in the Program Unit node of the object navigator create the following;
    /* Form variables package spec */
    PACKAGE Form_Vars IS
      CheckBox_Cnt     NUMBER := 0;
    END;Now in your When-Checkbox-Changed trigger...
    BEGIN
       IF ( Form_Vars.CheckBox_Cnt = 0 ) THEN
          Form_Vars.CheckBox_Cnt  := Form_Vars.CheckBox_Cnt  + 1;
       ELSE
          /* it's assumed the value is greater than 0 */
          Message('Please uncheck selec ted record before choosing a new record.');
          RAISE Form_Trigger_Failure;
       END IF;
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on Feb 3, 2011 10:15 AM

  • Popup screen with two check box and a text area for the user to enter value

    hi,
    i have a requirement when a button is clicked a popup screen should appear with two check box and a text box where the user can enter a value.
    is there any function module which has that functionality

    Hello,
    You can create a new screen and select the screen type as <b>model dialog box</b>.This will give you a<b> pop-up screen</b> and you can call this model dialog box screen in the PAI of the screen where the button is present.(At user-command).
    <b>case ok_code.
    when 'BUTTON'.
    call screen 200 starting at 10 10.</b>
    You can design the PBO of this pop-up screen as per your needs.
    Regards,
    Beejal
    **Reward if this helps.

  • How to set uncheck in Bidder check box in T-Code "BBPMAININT"

    Hi All,
    Could any body help me by providing the information "How to set uncheck in Bidder check box in T-Code "BBPMAININT". I search all the BADI and EXIT but didn't get.
        My problem is that, I want to uncheck "BIDDER" check box for Vendor whose account group is "ZORD" in transaction "BBPMAININT". I checked all the BADI and Exit but didn't get.
    Regards
    Sanjay

    Hi
    Which SRM version are you using ? Please elabore your requirments in more details in the next reply.
    <b>Meanwhile, please try the following SAP OSS Notes -></b>
    Note 512218 - Ext. partner maintenance: checkbox problems
    Note 455440 - Ext. partners without contact person: Checkbox problem
    Note 585126 Correction of Section508 implementation
    528367 Multiple company: Evaluated receipt settlement
    527097 BBPMAININT: 'Undo All' not complete
    361829 EBP (BBP2.0C): Business partner <-> vendor mapping
    Note 357201 BBP 2.0B: Business partner <--> vendor mapping
    Note 355506 Ext. no. assignment when creating business partners
    Do let me know.
    Regards
    - Atul

  • How can I use if with a check box to perform a formula?

    I would like to have a column with a cheek box which, if ticked, performs a formula in the next column. Would anyone know how to do this?

    Is this what you mean?
    B1=IF(A1=TRUE, C1+D1, "")
    this is shorthand for select cell B1, then type (or copy and paste from here) he formula:
    =IF(A1=TRUE, C1+D1, "")
    Check box not checked:
    Check box checked:
    when the checkbox is checked cell B1 will contain the sum of cells C1 and D1 otherwise cell B1 is empty

  • ADF Tree with Boolean Check Box: How to find selected items

    Hi Experts,
    ADF: 11.1.1.5.0
    WLS: 10.3.6
    I am using an ADF Tree which contains elements at two levels (say Departments and Employees). My requirement is to give provision for user to select Departments and Employees using the check boxes. User should be able to select what ever Departments he/she likes and what ever employees he/she likes. There should not be a provision to select Employee with out selecting the corresponding Department (root node in the tree).
    I am facing the below issues while trying to implement this use case:
    1. Always, only the first master record will be expanded by default (I am using "Display Row" property value as "default" and "ExpandAllEnabled" as "true"). My need is to expand all the master records by default. So that user need not explicitly expand each master record node and then select the associated child records.
    2. Currently, I am using value change listener associated to af:selectBooleanCheckBox to identify the Departments and Employee records that have been selected. Since not all departments (masters) are expanded by default, if user selects the check box of department (master) and then expands the department node, automatically all the employees of that department are selected. But, this event is not triggering the value change listener for the employee records. Because of this, after a department node is selected and then expanded, all the child elements' check boxes are selected but the events are not generated. Hence, I am not able to capture the selection of employee records.
    To summarize,
    1. Please let me know how to expand all master nodes in af:Tree by default.
    2. Please let me know the best approach to identify the selected items (both master and detail items) in the af:Tree component using af:selectBooleanCheckBox.
    Thanks in advance,
    Rathnam

    Hi,
                Can you please elaborate the solution? I have a similar problem in
    https://forums.oracle.com/thread/2579664

  • How to automate the adding of check-box along with each numbered item in Framemaker file ?

    I tried using the wingdings font as check-box. But I don't want to use it manually every time. I want to have it as a style part of my procedure style (numbering style).   I need the check-box along with each numbered item. Whenever I apply my numbering style in FM, I should get something like:
    " <checkbox> 1. <text> "

    Use "N:\u2751\ <n+>.\ " for the autonumber format.
    "N" Use counter N
    "\u2751" One of many checkboxes available in Unicode
    "<n+>" increment the counter
    "." ordinary period
    "\ " non-breaking space
    This assumes that you are on FM8 or later, and your Unicode font has that glyph code point populated (Arial Unicode MS does if your font doesn't).
    Don't use WingDings (or Zaph Dingbats) anymore. Using codepage overlays has any number of issues, and these two sets of legacy codepage dingbats don't even match each other.

  • How to with the check box in Suppliers - Contact Directory

    EBS R 12.
    I am in need of finding a solution for the following:
    Payables Manager -> Suppliers -> Inquiry -> Select a supplier -> Go to "Contact Directory" -> Select a contact
    Under User Account section there is a check box.
    When I check the check box, the following action should happen:
    1. The "Username" field must contain the value of the "Email".
    2. Under "Responsibilities" "Sourcing Supplier" must be checked.
    I don't know where to put my hands to solve this problem.
    All helps will be appreciated. Thanks.

    Hi
    SPRO - SAP IMG- Material management - Inventory management and physical inventory - Goods receipt - create purchase order automatically - activate auto Po creation for movement type.
    Then activate the auto PO creation in Vendor master - Purchasing view
    Check it out.
    Regards,
    raman

  • Duplicating address data option for second applicant with a check box

    I've been searching and trying things out for hours now, without success.
    I'm not sure if this is PDF Forms question or whether I should be posting to the Java forum, but here it is:
    I have an PDF application form with several fields for mailing address data (street address, city, state). The application also has an area on another page of the form for a second applicant. The second applicant has an area for their mailing address too.
    I'd like to create a check box for the second applicant that says "Same as first applicant", so that if it's checked the address data in all three fields automatically populates the same information that was completed for the first applicant in those fields.
    I assume this might be something that required some custom JavaScript but I know very little about how to write code. I've tinkered with a few thinks I found online but nothing seems to work. Any information that could help me out would be much appreciated.

    A bit more complicated, but not by much. So basically you can use this script as the MouseUp action of the check-box (notice I used generic field names here, you can replace them with the actual ones in your file):
    if (event.target.value=="Off") { // the box is NOT ticked
        this.getField("Target1").value = "";
        this.getField("Target2").value = "";
        this.getField("Target3").value = "";
        this.getField("Target4").value = "";
        this.getField("Target1").readonly = false;
        this.getField("Target2").readonly = false;
        this.getField("Target3").readonly = false;
        this.getField("Target4").readonly = false;
    } else { // the box IS ticked
        this.getField("Target1").value = this.getField("Source1").valueAsString;
        this.getField("Target2").value = this.getField("Source2").valueAsString;
        this.getField("Target3").value = this.getField("Source3").valueAsString;
        this.getField("Target4").value = this.getField("Source4").valueAsString;
        this.getField("Target1").readonly = true;
        this.getField("Target2").readonly = true;
        this.getField("Target3").readonly = true;
        this.getField("Target4").readonly = true;

  • How to add unique id to check box in a table

    Hi Experts,
    I have a static table in which more than 500 records appears in the table, so vertical scroll is displaying in the table. In each row, check boxes and text boxes displays with the data. When the check box is selected, I will do the calculation based on the selected check box and displays the calculated value to text control of respected row. To achieve this, I am triggering the event iterating the loop over the context to find which check box is selected. When the page gets refreshed, cursor moves to first record.
    Since all the check boxes having the same id, I am not able to get from which check box this event has got triggered.
    Is there a way to assign unique id to each check box so that I can assign parameter to the control and get from which check box event got triggered. I have tried to generate the table dynamically, even there I couldn't assign id to each check box.
    Please through light on this request
    Thanks
    Murthy

    It is not specific to any platform but common in all whether is CE or 7.0 follow the given procedure
    1. Create a common onLeadSelect of table say it      selectedRow
    2. Assign the same event in onToggle     selectedRow  of checkbox.
    3. Now loop it in such a way that
         if (wdContext.nodeAppinvoiceData().getLeadSelection() >= 0)
                   wdContext.currentAppinvoiceDataElement().setIsPreviewSelected(true);
                   if (wdContext.currentAppinvoiceDataElement().getIsSelected())
                        wdContext.currentAppinvoiceDataElement().setIsSelected(false);
                        for (int i = 0; i < wdContext.nodeAppinvoiceData().size(); i++)
                             boolean flag = wdContext.nodeAppinvoiceData().getAppinvoiceDataElementAt(i).getIsSelected();
                             if (flag)
                                  break;
                             else
                   else
                        wdContext.currentAppinvoiceDataElement().setIsSelected(true);
              wdContext.currentAppinvoiceDataElement().setIsPreviewSelected(false);
              wdContext.nodeAppinvoiceData().clearSelection();
              wdContext.nodeAppinvoiceData().setLeadSelection(-1);
    BR
    Satish Kumar

  • How to block unchecking of a check box in a JTable

    i have a JTable. Its 1st column is a check box. i want for the first two rows user can not de-select the check box.
    How i will do it ?

    Hi,
    Sub class DefaultTableModel and override the method isCellEditable(int row, int column)
    Piet

  • Problem with a check box in SBO 2004

    Hi
    I have created a form in screen painter which is linked to a user defined object. All the text fields are being saved ok to the table.
    I have just added some check box's but there not working correctly. I can tick the box but not deselect it. It doesn't seem to be saving it either. It is bound to a single character field in the table.
    Does anyone have any ideas pls ?
    Regards Andy

    Hi Adele
    I just cracked it, if I add the fields in code it worked. I then went on to save the form in xml and compare it to my screenpainter code. Valoff and Valon are not set because they are not options in screenpainter.
    Agrees with what you said, what do you think ?
    Regards Andy

  • How to Maintain Payment with one check for Multiple Vendors?

    Dear Gurus,
    i have a scenario for outgoing payment, here it is
    i have some open items for multiple vendors. say it for open item
    1. with amount 5000 USD for vendor A
    2. wiht amount 10000 USD for vendor B
    my company pay both open item 1 & 2 with one check, say the check no is 27382830 and the amount is 15000 USD. The check is given to the Bank as an order to Pay the vendor. so the check does not have receiver name. i attach a formal letter to the bank to ask them for making payment with that check. the letter contains a detail the amount, vendor bank account number, account holder, and the vendor name.
    so how i can threat this business scenario into SAP? i want to trace check number used to pay the vendors.
    hope you can give some clues. is it possible to maintain scenario above with automatic payment?
    best regards,
    land lord

    Hi,
    Yes you can map this scenario in SAP and use F110 for this. But you will also have to use some Z programs..
    1. For F110 FBZP configuration, maintain outgoing bank clearing Account (this will be a dummy account and not the actual Outgoing Bank Account) as the Bank Sub Account.
    By doing this when you run payment in F110, entry will be
    Vendor A A/c...Dr.
    outgoing bank clearing Account Cr.(1)
    Vendor B A/C... Dr.
    outgoing bank clearing Account Cr.(2)
    2.Then you will have to use Post with clearing transaction codes and make one entry
    outgoing bank clearing Account Cr.(1)..Dr.
    outgoing bank clearing Account Cr.(2)..Dr.
    To Bank Outgoing Account(Actual Bank outgoing Account) Cr.
    3. Now, when you get the single cheque no. from Bank against both the vendors, then thru FB02, change the assignment field/Reference field for Che No. updates.
    But do check BRS also for its reconciliation.. If you do it on a daily basis.. then it would not be difficult.
    Hope this helps you..
    Regards,
    SAPFICO

  • Linking/Grouping Text Fields with a Check Box Field

    Disclaimer: I know nothing about coding/scripting in Acrobat (or in any language, for that matter).
    I have 4 sets of text fields, call them A, B, C, and D. All of the fields in set A will have a value entered. There are 10 fields in set A while sets B, C, and D may have as many as 104. Sets B, C, and D will always have a one-to-one-to-one correspondence with each other (B1 is associated with C1 and D1 only and so on). My dilemma/desire is two fold:
    First:
    I want to be able to group 3 to 4 of the fields in set C if I tick a check box/radio button/whatever field type works. When the fields are grouped, I want their values to be the same within the grouping. These fields should also be ungrouped when the marker field is unchecked/deactivated. No field will ever be in any more than one group.
    Second:
    I want values for set B to equal a value of set A if there is a value entered in that B's corresponding C field.
    Please don't hesitate to point out where I can make any of this clearer.
    Thank you in advance,
    Joseph
    P.S.
    If one or both of these is not doable in Acrobat, would you please kindly point me to a program that can do this?

    Steve,
    Sorry, I referenced InDesign and this file was created in Illustrator. (I have been working with numerous files created in both InDesign and Illustrator, with numerous challenges). I do not have the native document nor Illustrator software, only Acrobat. When I previously loaded the InDesign-created pdf file(s) into Acrobat, I was unable to use the Text TouchUp Tool because I do not have the fonts on my system that were used to create the documents in InDesign, thus I am denied access to the text. With this file, created in Ilustrator; I assume because the text resides within the image created that encompasses the entire page, the Text TounchUp Tool and Object Tool have no response when I click on the page after activating the tools with a click, although the Tool Bar allows me to click on the icons to activate the functions.
    I have read elsewhere that InDesign and Illustrator files are exported as images, thus requiring either Photoshop or Illustrator to fully edit outside of the originating software. However, I was hoping that I could create interactive forms by overlaying fields with Live Cycle Designer - I did not anticipate the default setting of the check box labels being unchangeable. Sounds like I am at a dead-end with this issue??
    Linda

  • Pop_up window with a check box

    Hi Gurus,
    iam having requirement to display a popup window with two message texts and with a message followed by a check box. i have tried with all the function modules starting with popup_* but iam not able to find the exact one. please suggest me a solution where i can display two textmessages and a message followed by check box.
    the below is the order in which i need to display data in my popup window.
                                        Message text1.
                                        Message text2.
                       checkbox   Message text3.
    <REMOVED BY MODERATOR>
    Thanks ,
    Kishor.
    Edited by: Alvaro Tejada Galindo on Feb 11, 2008 6:05 PM

    Hi Sriram,
    thanks for u r reply. but i dont want radio buttons in my popup window. i want a checkbox followed by message text. i.e., in the for mat
       message text1          -
    >  text1
       message text2         -
    > text2
    checkbox message text3 -
    >text3
    yes    no     cancel      -
    > Push buttons.
    all the above requirements has to be there in a popup window. please give me correct reply....
    Thanks,
    Kishor.

Maybe you are looking for

  • Java Web service

    Hi I need some help with task I have to do. i mast make a " Java web service builder for java application". The problem is that I don' t know exactly what i have to do and how to start. I just know that I need a interface where the user can upload ja

  • How many airport express can be supported by software remote at one time.

    how many airport express can be supported by software remote at one time? I mean remote software can control at one time

  • Error in cropping pictures through iPhone photo edit option

    If i try to crop an image (using the iPhone edit option) that i saved to my photo library (while browsing the internet e.g.), once i click save the image gets completely blurred out (into small pixel) cubes. Doesn't happen with images that were click

  • CS6 document flashes black and checkerboard

    I purchased an update for PSCS6 disc.  Whenever I use a slider in editing (such as adjusting hue, contrast, etc.) the background on my screen flashes back and forth between black and grey/checkerboard!  It does this as I slide the slider in all adjus

  • HT4101 How to print photos from ipad

    Is there a way to connect ipad to a photo printer at walmart?