In: toggle a field based on the State of a checkbox

Hi all
I have a tabular form on a single table. The table has a Y/N column type. So to see this checkbox column I followed excellent tutorial http://www.inside-oracle-apex.com/checkboxes-in-tabular-forms-the-easy-way/ Patrick

It works very well. But now I also want to turn another field based on the question of whether this check box is checked or not. To do this, I followed another post on how to do it and it also works. But the problem is when I try to save the form, I get the dreaded MRU error.

Tabular form fields
NAME, SALARY, ACTIVE

NAME-> Normal text box
SALARY-> I want this field to be enabled/disabled based on the value of the last column ENABLED_CHECKBOX
ENABLED_CHECKBOX-> it's a checkbox (created by following the tutorial of Patrick)

What I did to make SALARY toggle dynamically (it works, but I get error MRU registration)
Change ENABLED CHECKBOX_
ENABLED_CHECKBOX-> This is a standard report with the following HTML Expression field:
"< pre > < input type ="checkbox"#ENABLED_CHECKBOX # value =" "#ROWNUM #" name = "f40" id = "f40_ #ROWNUM # ' class = 'MyClass' / > < / pre >


Additional dynamic action
WHEN = change event
Selection type = jQuery Selector
JQuery Selector = .myClass
Condition = no requirement

Real Action = run Javascript

Code =
< pre >
column_2_id = "f02_000" + $(this.triggeringElement).attr('id').substr (4);

If (.attr ('checked')) $(this.triggeringElement)
{
$("#"_+_column_2_id).attr ("disabled", "disabled");
}
on the other
{
$("#"_+_column_2_id).attr ("disabled", false);
}
< / pre >

Sylvie,

You must reactivate the fields before being submitted, because the disabled fields are not subject at all - and that throws what APEX collections uses tabular forms. See my post here.

Short version: use something like this as an action dynamic javascript before submitting the form:

$('input:disabled').attr('disabled',false);

-David

Tags: Database

Similar Questions

  • How to calculate the sum of two digital form fields based on the selection of the checkbox.

    I have a form in Acrobat Pro who needs a custom calculation. How to calculate the sum of two digital form fields based on a selection of the checkbox. I have three number fields. Field-A and B are simple one or two digits. Field-C is the sum, or the total field. I want to field-C have a control box which, when turned on and off, just gives a. gives the sum of A + B

    _ Field - 2

    _ Field - A 4

    [check] _ _ field - 6 C

    [disabled] _ _ field - 2 C

    Thank you

    The custom field C calculation script could be:

    (function () {
    
        // Get the values of the text fields, as numbers
        var v1 = +getField("A").value;
        var v2 = +getField("B").value;
    
        // Set this field's value based on the state of the check box named "CB"
        if (getField("CB").value !== "Off") {
            event.value = v1 + v2;
        } else {
            event.value = v1;
        }
    
    })();
    

    Replace 'A', 'B', and 'CB' with the real names of the fields.

  • Auto-fill text box values field based on the selection of the menu drop-down

    Try to fill in address, city, province, zip from text fields based on the selected option in a select form field. The following code works fine in Internet Explorer, but in Chrome or Firefox, after selection, text, the fields are filled with the word "undefined."

    I found a PHP script Jquery here version that would probabably do the trick.
    http://StackOverflow.com/questions/3657127/jQuery-populate-text-input-from-table-based-on-select-Valeur

    Maybe someone has a version of CF. they could share?

    Thanks in advance to anyone who can point me to a solution for this code, or a better way to fulfill my need.

    <!--> destinations with address auto-fill, city, etc.
    < script type = "text/javascript" >
    function selectAddress (list) {}
    take the first element is empty
    If (list.selectedIndex > 0) {}
    var locationID = list.options [list.selectedIndex] .value;
    locationAddress var = list.options [list.selectedIndex] .locationAddress;
    var locationCity = list.options [list.selectedIndex] .locationCity;
    var locationState = list.options [list.selectedIndex] .locationState;
    var locationZip = list.options [list.selectedIndex] .locationZip;
    document.getElementById('locationID').value = locationID;
    document.getElementById('locationAddress').value = locationAddress;
    document.getElementById('locationCity').value = locationCity;
    document.getElementById('locationState').value = locationState;
    document.getElementById('locationZip').value = locationZip;
    }
    }
    < /script >
    < b >
    < td align = 'right' bgcolor = "#FFFFFF" valign = "top" > Destination name < table >
    < td align = "left" bgcolor = "#FFFFFF" valign = "top" >
    < select name = "locationID" onChange = "selectAddress (this)" class = "smallforms" > "
    < option value = "" > SELECT the DESTINATION ››› < / option >
    < cfoutput query = "allLocations" >
    "" < option value = "" #locationName # "locationAddress =" #allLocations.locationAddress # "locationCity =" "#allLocations.locationCity #" locationState = "#allLocations.locationState #" locationZip = "#allLocations.locationZip #" > #locationName # < / option >
    < / cfoutput >
    < / select >

    Others: cfinput name = "destinationNameOther" type = "text" class = "smallforms" size = "75" >
    < br / >
    < input id = "locationID" name = "locationID" type = "hidden" > < br >

    Address: < input class = "smallforms" id = "locationAddress" name = "locationAddress" type = "text" size = "30" >
    City: < input class = "smallforms" id = "locationCity" name = "locationCity" type = "text" size = "20" >
    State: < input class = "smallforms" id = "locationState" name = "locationState" type = "text" size = "2" >
    Postal code: < input class = "smallforms" id = "locationZip" name = "locationZip" type = "text" size = "8" > < br / >
    < br / >
    < table > < /tr >

    In your last code done selectAddress refers to "index" but I'm not declared or assigned. I think that you are missing 'var index = list.selectedIndex;' statement.

  • How to I raise an event based on the State of a button?

    I'm trying to trigger an event based on the State ON / OFF button.  When I click on the button, I want the structure of the event in a loop to trigger each iteration until the button goes back to the OFF position, manually or programmatically.  Is there an easy way to do this?

    Thank you very much.

    A structure of the event is absolutely necessary?  It's so simple with just a case structure, as shown in figure 1.  If you use a structure of the event, you can place the structure dealing with the push button inside the time-out event, as shown in Figure 2.

  • Hide a line based on the State.

    Hello, I have a requirement where I have to hide a line based on the State. I am able to highlight the lines but hide the entire line does not work.

    Condition must be met on a line:

    • Thus, if a sum of EXP5_11, EXP6_11, EXP7_11 and EXP8_11 in a current group is all zeros hide this line. Please refer to the RTF-model.

    Attachments:

    • RTF-model.
    • XML file.
    • Sample output generated when the lines are highlighted the meeting status.

    Any help is much appreciated on how I can hide a line.

    EM-: [email protected]

    If please remove your IF condition and add the following code inside the foreach tag

    This works very well in my test.

  • Custom color in display Gantt chart based on the State - Apex 4.2

    Hello

    I need to specify the custom color display Gantt chart based on the State.

    Say: Open - Red

    Progress-yellow

    Cancelled - blue

    Closed - Green

    given that the status column is not part of Gantt chart question, how?

    Option color in table attributes is not helping this requirement.

    Kind regards

    Sanjaya

    Hello

    Finally, the problem is resolved with the help of Hilary Farrell-Oraclefantastic example and help anychart pages. This is useful for this URL.

    https://Apex.Oracle.com/pls/Apex/f?p=36648:30:102588100613368:

    http://6.anychart.com/products/anygantt/docs/users-guide/index.HTML?project-Gantt-chart.html

    http://6.anychart.com/products/anygantt/docs/users-guide/index.html?defaults.html

    -Sanjaya

  • rename several virtual machines based on the State of food &amp; VM name

    I'm looking for a powershell script to rename the virtual machine based on the state name and vm power.  For example, I have several virtual machines with a - temp at the end of the name of the server.  Some are turned on and some are turned off.  I am wanting to rename only those who is off

    Thank you

    tjw82

    Assuming that - temp is part of the name

    Get - vm | where {$_.powerstate - eq "poweredoff"} | foreach {Set-machine virtual - VM $_ - name (($_.name).)} Replace ("temp", "delete"))}

  • Toggle the fields based on the choice of the user

    Hello!

    I need to create a form in which it fields should be enabled based on the user's choice in a previous question (with radio buttons).

    Please, where can I find the info to learn how do?

    Thak you responsible for any idea!

    Here's the Script Editor of screen capture...

    Once the script editor opens, then edit the event click in the menu on the left corner.

    Thank you

    Srini

  • Security level CSA 4.5 setting based on the State of the user

    It is of course possible to toggle the guardrail on the graphical interface through a rule (in the operating system - based permissions policy).

    But, it is possible to define or allow the service to be stopped is based on a State of the user? I can't see how allow/disable it in all areas...

    I have a Local Administrator and a State of NO Local Admin user who work very well with the Modules, but I can't find a way to attach it to the level of safety...

    In the end, I want to be able to affect security low switch, but only if connected as a LocalAdmin...

    See you soon

    As far as I know, you would do this by creating different strategies for each different user state and then using user status option in each strategy to differentiate the rules applied

  • How do fill you a text field based on the entries in other text fields?

    I would like to be able to have a text field that fills as 'Full' or 'Incomplete' based on the question if all required fields have been filled or not.

    For example, if the "First Name", "Last Name" and "City" text fields are not filled, the text of "the State of completion" field displays 'Incomplete' and once they are filled, the text of "the State of completion" field will turn into "Complete".

    How can I do this using javascript? I searched the web for a tutorial, but most of the results seems to be focused on the menu drop-down.

    Please point me in the right direction!

    Try the script below. I put this on the calculate for Field1 event

    If (FirstName.rawValue == null |) LastName.rawValue == null | City.rawValue == null) {}

    Field1.RawValue = "incomplete."

    }

    on the other

    Field1.RawValue = "complete."

  • How the auto fill a field based on the drop-down list unless the specific item is selected

    Hi all

    My apologies if I posted this in in the wrong place, but I am new to these forums, JavaScript and Adobe LiveCycle.

    I am trying to build a form using LiveCycle Acrobat but have problems with the drop-down lists.

    Inititaly I just wanted to fill in the fields in a table based on a matching menu selection dropdown in another table.

    I used the following code and it worked fine:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    The problem is that now I want the code above works UNLESS one of the items in the drop-down list is enabled specifically in this case, I want the text box in the other table to display a message such as "Details of the entry in the field below.

    I tried to create an If Else statement using the following code:

    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)

    fFrom var = xfa.resolveNodes ("Workbook.Content.Table1.Row3.AppropriationDetails [*]. Row4.cell1');

    OTF var = xfa.resolveNodes ("Workbook.Content.Table2.Row3.AppropriationDetails [*]. Row4.cell1");

    for (var i = 0; i < = fFrom.length - 1; i ++) {}

    If (fFrom.item (i) .rawvalue = "Option 3") {}

    fTo.item (i) .rawValue = "enter the details in the field below.

    }

    else {}

    fTo.item (i) .rawValue = fFrom.item (i) .boundItem (xfa.event.newText);

    }

    }

    The code now filled the field with "Enter the details in the field below" any item I select in the drop-down list.

    Your help is greatly appreciated.

    See you soon,.

    ozzy_q

    Hello

    You use .rawValue in the change event. This will cause problems because the selection of the users has not received .rawValue from the drop-down list at the time when the change event is triggered.

    Move your script as it should to the output of the dropdown event.

    Hope that helps,

    Niall

  • VBAI: Fire a pulse each msec N based on the State of inspection

    The delay function VBAI seems to have the functionality I'm looking for, but that is so rude that the time is 1 second minimum.

    I have a camera intelligent (1772). I do an OCR inspection that could take a variable quantity a little time. I would like an ejector will trigger if the inspection fails. The ejector must fire on a set amount of time after which the camera fires. If I can't do reliable, so I need another controller in the system that I should not need because the camera smart shoulkd be more than enough. I know it can be done in the RT, but I like to keep things in VBAI to facilitate customer training.

    Sequence of operations:

    1. travel less than 1772 on a conveyor parts

    2 sensor triggers 1772 when a part is present

    3 image is acquired and processed. OCR inspection

    4. If the OCR inspection fails, the output pulse fire exactly 100 (for example) milliseconds after the onset of step 2

    5. Repeat step 2

    No idea how to achieve this in VBAI?

    Thank you

    Dan

    You might have a step to generate impulses before your acquisition where the impulse is configured to generate a pulse based on a trigger (so set up a continuous pulse and you wire trigger for acquisition to an ISO so input line that will trigger the output). Now, this is the important part... you must ensure that your treatment is carried out before 100ms or some delay that you specify or the pulse will begin. If you determine that you need not pulse according to your treatment, the transition to a State where stop you a generation of pulses on this line to stop it before that happens. In both cases, passage to the final State, and then the inspection can start again with the State which has run impulses/Acquire/processes and therefore the pulse reconfigure again for the next part.

    If this does not work for you, then you can try a timed SW approach. You might have a running LabVIEW step that gets a precise timer value during the acquisition stage ends, and another VI call waiting for a specified duration user (millisecond resolution) before it continues.

    I recommend the first option because it will be hardware timed (but requires additional cables), and if it does not, I can help you with a VI that will make the timed SW the desired behavior.

    Hope that helps,

    Brad

  • How to disable the LOV values based on the State of some?

    Hello

    I have a requirement like this.

    (1) LOV Field (1), when I get a value here then based on the query I get two new values and assign to another two LOV Fields (2,3) and then disable them. However, when I enter the value in the field LOV (1) based on one of the conditions I won't have no default value then LOV fields must be enabled so that the user can select the values of LOV.

    (2) now an another LOV domain (4) when I go here again, then again two fields a LOV (5), and the free text field must be filled in.

    To do this, I wrote the logic in the following way:

    (1) get the LOV box-1 value and deriving the new values and set the session Variable to 1 and then refresh the Page. Now in PR get the Variable from Session 1 and assigning new values to LOV fields 2 and 3 and then using the property Setdisabled I deactivation.

    (2) getting the value of LOV field-4 and then drifting two new values and set the session Variable-2 and refresh the Page. Now in PR get Session-2, and then set the new values for the LOV-5 field and free text. But once the Page Refreshed and assigning values, values that we have given in the Point 1 in the LOV-2 fields, 3 turn white and field's get activated.

    Can you please let me how to achieve this? and also why the values are empty when I implement Point-2.

    Thank you
    Clarriiza

    Clarriiza,

    This VO have no matter what right SQL query, so even if you run the VO by using vo.executeQuery (), you will not get all the lines in the VO.

    So in the PR you need createRow and insert VO (otherwise your page no mistake) the below blog can be considered as an example.

    Reference: Oracle tips of Johny: OAF: how to create a PVO and use for Spel link in Oracle Application Framework

    On top of which is explained in the blog above, you set the values for the attributes of the useful, likely to set the value for the other LOV.

    I hope this helps.

    See you soon

    AJ

  • Auto create the value of a given field based on the range of percentage in another area

    Hello, people forum!  I am trying to create a field that fills a score based on the percentage in another area.  To this end, I have a field that autocalculates a percentage based on two other fields.  I would be close to a third field which, for example, the rate less 75% 2... 75 - 85% 3... and more than 85% 4.  I can't understand the syntax to make it happen, can anyone of you help?

    For the edification, my percentage field looks like:

    Calculation of the percentage of rock - use the number Format "percentage".

    If (this.getField("RockTotalQ").value == 0) {}
    Event.Value = 0;
    } else {}
    Event.Value = this.getField("RockComplQ").value/this.getField ("RockTotalQ") .value;
    }

    Thank you.

    You can use something like this than the calculation script custom in the other field (make sure that it appears after the 'Percentage of Rock' field in the calculation order, if!):

    var v = this.getField("Rock Percentage").valueAsString;
    if (v=="") event.value = "";
    else {
        v = Number(v);
        if (v<=0.75) event.value = 2;
        else if (v<=0.85) event.value = 3;
        else event.value = 4;
    }
    
  • show/hide fields based on the drop-down list of choices

    I have a field from the drop-down list with three choices. Based on the selection, I need a specific text form field to appear and the others to stay hidden. (Or if it makes the code cleaner, the resulting field could be a drop-down list, too, with the selected choice.) I don't know Java well enough to extrapolate the code from the examples online and it fit my forms. I can provide an example of form. Thanks in advance for your help.

    There are ways to run this.  the easiest for you would be to add this script to the event (calculation of the Properties tab) to calculate the field that must be hidden.  Take notes, all "/ /" is some tips for you to understand the code.  You will need to put this script in all the areas you want to replicate the behavior, change the value depending on what you want to accomplish.  the word 'event' means myself to make you understand.

    If (this.getField("dropdown").value == 'put value here') {//replace "drop down" with the name of the drops}

    Event.Target.Display = display.visible;

    }

    else {}

    Event.Target.Display = display.hidden;

    }

    This works if you have a small amount of fields.  If you manage to have a large number of similar fields, let me know because there are other, faster ways.

Maybe you are looking for