Set value in text field when checking checkbox

Hi,
I have a manual tabular form and when I check cb1 I want to set ben2 to Oracle.
Is there anyway I can do that?
Here you can see my very simple example:
http://apex.oracle.com/pls/otn/f?p=22968:3:4142231640027285:::::
My tabular form query:
select
to_char(dag,'day dd mon yyyy')||apex_ITEM.HIDDEN(1,pk) dag
, apex_item.text(2, ben1) ben1
, apex_item.text(3, ben2) ben2
, apex_item.text(4, ben3, null,null,null,'f04_'||rownum) ben3
, apex_item.text(5, ben4)||apex_item.hidden(6, cb1) ben4
, apex_item.checkbox(7, ROWNUM, 'onclick="test(this)"',DECODE (cb1, 'Y', ROWNUM)) cb1
from dummy
Regards Daniel

Hi Anirban,
The sql-query for the report:
select
to_char(dag,'day dd mon yyyy')||apex_ITEM.HIDDEN(1,pk) dag
, apex_item.text(2, ben1) ben1
, apex_item.text(3, ben2) ben2
, apex_item.text(4, ben3, null,null,null,'f04_'||rownum) ben3
, apex_item.text(5, ben4)||apex_item.hidden(6, cb1) ben4
, apex_item.checkbox(7, ROWNUM, 'onclick="test(this)"',DECODE (cb1, 'Y', ROWNUM)) cb1
from dummy
On the region, Header and Footer -> Region Header
<script type="text/javascript">
function test(pThis)
if(pThis.checked)
{document.getElementById('f04_'+pThis.value).value = 'Checked';}
else
{document.getElementById('f04_'+pThis.value).value = 'Not Checked';}
</script>
That's all.....
/Daniel

Similar Messages

  • Change the background of a text field when a checkbox is checked?

    Hi,
    I'm new to Adobe JS, having done some browser scripting previously.
    I'm making a form in which I would like to change the background of a text field to bright yellow (RGB code 220,220,0) when a corresponding checkbox is checked?
    I have a checkbox named chkCD56, with an option value set to 1.
    I have a text field named CD56 with a transparent background.
    Can someone help me with the JS code?
    Thanks.

    Hi
    To make your number filed in Red :
    Right click on the field and go in format field click on Font tab and go in Color formula editor and give the following formula :
    If Sum(fieldValue} < 0 Then CrRed else CrNoColor
    Now go in Style formula editor and give the following :
    if sum() < 0 then Critalic
    This will make your field red and italic when it is less than 0
    Thanks,
    Sastry

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • Saved text fields and check-boxes empty when 3D window activates

    I've created Text Fields and Check-boxes in a pdf template, using LiveCycle Designer.
    I create the 3D work in Reviewer, and use the pdf template during Export to 3D pdf.
    Using 'Extend Features in Adobe Reader' the user can fill in the text fields, and click the check-boxes then save them with the pdf  - just using Reader.
    So far this is great!
    The problem comes when the pdf is opened again and the 3D window (A3DR_3DFrame) activated.
    All the completed fields empty!
    This is not great at all!
    I've did some tests and found that the filelds only clear if I include the Configs selection list box with the special name 'A3DR_Configs' in the template pdf. (A3DR_Configs lists the Configs stored in the 3D Reviewer file and the user can select the config from that list).
    This is unfortunate, as the A3DR_Configs window is useful since it indicates to the user which 3D config is currently being viewed (ie the name of the current config stays highlighted).
    Is this a bug that can be fixed or is there a workaround?
    thanks,
    Ian

    Would you mind to post your commenton the the approriated Adobe forum page ?
    This one is dedicated to Acrobat 3D
    The correct forum page for Designer is:
    http://forums.adobe.com/community/livecycle/livecycle_es/livecycle_designer_es
    Thanks in advance
    William

  • How do I add and remove text in a text field with a checkbox?

    How do I add and/or remove text in a text field with a checkbox?
    this is my script in the text box......
    event.value="Hello, this is my narrative. \r\n\nFamily: \r\n\n" + this get.Field("FirstName").value + " " + this.getField("LastName").value + was born on"=this.getField("DOB.value + "\r\n\n + this.getField("drpField").value + "\r\n\n" + this getField("Father").value
    The text box looks like this...
    Hello, this is my narrative.
    FAMILY:
    John Smith was born on 08/02/2000
    Boby Lou
    Jack Smith
    I need to add/or remove the father field (Jack Smith) & r/n/n with a check box.
    Does anyone know how to do this?

    There are multiple errors in your code...
    Use this code instead (adjust the name of the check-box):
    var msg = "Hello, this is my narrative. \r\n\nFamily: \r\n\n" + this get.Field("FirstName").value + " " + this.getField("LastName").value + was born on" + this.getField("DOB.value) + "\r\n\n" + this.getField("drpField").value;
    if (this.getField("FatherCheckBox").value!="Off")
         msg += "\r\n\n" + this getField("Father").value;
    event.value = msg;

  • How to script text field based on checkbox selection

    I've written a script to format specific text boxes based on what checkbox is chosen. However, I'm not sure what I need to script in order to CLEAR the text field once the checkbox is unchecked. As it stands now if the checkbox is selected it formats the text field with the necessary information, but if it's unchecked the information stays in the box. I'd like to be something like 'if all boxes are Off then display 0.00.' I've included the current script for reference
    var one = this.getField("Emp 500");
    var two = this.getField ("Emp+C500");
    var three = this.getField("Emp+S500");
    var four = this.getField("Fam500");
    var five = this.getField("NC500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='70.70'}        
    else if (two.value ==
    'Yes') {six.value='127.20'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='198.00'}
    else if (five.value == 'Yes') {six.value='0'}
    var one = this.getField("Emp 1500");
    var two = this.getField ("Emp+C1500");
    var three = this.getField("Emp+S1500");
    var four = this.getField("Fam1500");
    var five = this.getField("NC1500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='61.47'}
    else if (two.value == 'Yes') {six.value='110.49'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='123.04'}
    else if (five.value == 'Yes') {six.value='0.00'}

    Hi Gayathri,
    Gayathri Venugopal wrote:
    Hi,
    I have two text items. Need to create dynamic action for the following,
    1. Order_type - Drop down values having CONSUMER & WHOLESALE.
    2. Order_number- Text field
    Order number should be disabled and only on selection of order type ,order number should be enabled.
    Can someone please help me on this?
    Create two dynamic action
    1. Make it order number item disable on page load.
       Event : Page Load
       Action : Disable
       Fire When event result is : True
       Selection Type : Item
       Item : Your order number item
    2 . enable and disable order number on selection of order type(assuming when order type is null it is disable otherwise it is enable)
        Event : Change
        Selection type : item
        Item : your order type item
        condition : is not null
    True Action
        Action : Enable
        Fire When event result is : True
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    False Action
        Action : Disable
        Fire When event result is : False
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    Hope this helps you,
    Regards,
    Jitendra

  • Formatting of text fields when exporting from InDesign to Acrobat Pro

    How does one preserve the formatting  of a text field when exporting from InDesign CS6 to Acrobat Pro? It loses both the font and the alignment formatting in the PDF.

    Use a font that allows embedding/ check the font embedding settings in the PDF output settings.
    Mylenium

  • Position cursor in text field when form is opened

    Another newbee question I'm afraid!
    I want to position the cursor in a text field when a user opens the form. I can't find a way to do it but I'm pretty sure it's straightforward!
    Also, can I remove fields from the tab order?
    Thanks (for your help and patience!)

    Hi,
    You would select the object that you want to receive focus and put the following in the docReady event.
    xfa.host.setFocus("this");
    The docReady event is a good one to use, because it only fires once.
    The tab order can be set in the Tab Order tab. Depending on the version of LC Designer that you have, the flexibility will vary. However I would do this as a last step, as any changes can throw the tab order out of sequence.
    Note that tab order is greatly affected by the relevant x/y coordinates of objects and where objects are in separate subforms.
    Hope this helps,
    Niall

  • How to give error message for the screen element text field when wrong i/p

    How to give error message for the screen element text field when wrong i/p
    when wrong input given
    eg. 
    I have a text box with SBOOK-CARRID
    so when user give wrong entry in text box i.e LG
    then I should give some error stating that the the input is invalid or not available ,
    now it showing the error of standard messages,
    i want manual message to be displayed when error comes.
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    Hi all,
    Thank you for your valuable reply,
    but the thing is that its a screen field,
    i.e text box not a selection screen
    i created in screen layout
    with name sbook-carrid
    now i want to get error message display if wrong i/p is given
    thank you.
    Regards,
    Jagrut bharatkumar Shukla,

  • No select all text in text field when I mouse in

    Hello
    How can I go to next row in a multi-text field when I point my mouse in?
    That is, I don't want (when I fire in) have all text select but i want write soon, otherwise as soon as i begin to write all text inserted in it is deleted
    Thanks

    HI user560737,
    After over 170 post still
    a. No Forms version
    b. No friendly handle
    c. Inadequate and incomprehensible description
    Perhaps one or more of the following are true
    1. Members of this forum are not equipped to help you.( So, why bother to post?)
    2. You are not appreciative of the help being extended to you, in the form of marking posts helpful / correct
    3. You do not articulate and follow through on your post.
    How else can one explain
    Handle:      user560737 Status Level:      Newbie
    Registered:      Feb 24, 2007
    Total Posts:      171
    Total Questions:      37 (35 unresolved) >
    How can I go to next row in a <b>multi-text field</b> when I point my mouse in?That is, I don't want <b>(when I fire in)</b> have all text select but i want write soon, otherwise as soon as i begin to write all text inserted in it is deleted

  • How do I auto populate the date into text fields when form is first opened?

    Hello,
    I read all about the changing the scripts but its not really working for me. I was hoping someone could help me with directions on how to auto populate the date into designated text fields when my adobe document is first opened?
    I am working in Adobe Acrobat 9.
    Thank you,
    Sheri

    When you add a new document JavaScript (Advanced > Document Processing > Document JavaScripts > Script Name (enter something) > Add), you will be given a function skeleton by default. Just delete it and enter the line of code I showed above. Now, whenever the document is opened, the code will get triggered and the field will be updated with the current date. There is no "Document Open" action (at least that's accessible via Acrobat's UI), but this is effectively the same thing since any document-level JavaScripts are executed when the document is opened.

  • Check for text in a text field and make checkbox mandatory

    I have a text field where if the user has entered a value, then the checkbox that follows must be mandatory. I have this script that works (sort of), but I'm not sure which event to use to get the results I want. I want the message and the checkbox to be mandatory only if something is typed in the field.
    Here's the script:
    if ((this.rawValue != "null") || (this.rawValue != ""))
         CheckBox3.mandatory = "error";
         app.alert("Please indicate that you have reviewed the similar profile and approve it");    
    else if ((this.rawValue == "null") || (this.rawValue == ""))
         CheckBox3.mandatory = "disabled";
    Thanks,
    MDawn

    That worked. Thank you. I have another problem now. If the user deletes the information typed in the text field, the message box still displays and the checkbox is still outlined in red indicating it's required and it shouldn't be.
    Thanks,
    MDawn

  • How to display date in a text field when a calendar is clicked

    hi
    I have a button i placed a calendar image in that button.when i click that button it displaying a calendar,when i click that calendar it is displaying the specific date .
    what i want is,when i click the calendar the specific date must display in a text field.
    please help me.
    thanks in advance

    Hi Arch,
    Go to the following link and check JCalendar API (needs to create a login for downloading JAR)
    [JCalendar API @ dev.java.net|https://jcalendar.dev.java.net/]
    it is a nice JCalendar with lot of options. Also it is working. You can download the JAR file and use it in ur program.
    From this component, you can read out the Date value and then set the text of JTextFiled using this value.
    or go for another implementation
    [Another JCalendar|http://www.gimlisys.com/articles-jdatechooser.html]
    Sunil

  • Populating Text Field from Multi Checkboxes

    Need help with formula.  Not sure whether or not I should be using FormCalc or Javascript as I am not extremely familiar with either.  I have a form that has three checkboxes (Box1, Box2, & Box3) that need to auto populate a text field (EmpAck).  I have tried three different ways to get this done and none are working for me.  What I need to happen is if "Box1" is checked "Text1" is inserted in "EmpAck" field and if "Box2" is checked "Text2" is instered & so on.  The texts are never the same and never added together.  I have set "EmpAck" to be read only, allowing multiple lines, and have the "Expand to fit box marked as the texts' are different lengths.  Any help would be great.
    1. // This would go in the Textfield under calulate using FormCalc
    if (Box1 = "On") then
    EmpAck = "Text1"
    elseif (Box2 = "On") then
    EmpAck = "Text2"
    elseif (Box3 = "On") then
    EmpAck = "Text3"
    endif
    2. //This would go in the checkbox "Box1" changing "Text1" to "Text2" or "Text3" as required under mouseup using JavaScript (found under http://forums.adobe.com/message/2489082#2489082)
    if (this.rawValue == 1)
    {EmpAck.rawValue = "Text1";}
    else {EmpAck.raqValue = " ";}
    3.//This would go in textfield under calcuate using JavaScript (found under http://forums.adobe.com/message/4108395#4108395)
    var a =" "
    if (this.getField(Box1).value == "Yes")
    {a="Text1"}
    if (this.getField(Box2).value == "Yes")
    {a="Text2"}
    if (this.getField(Box3).value == "Yes")
    {a="Text3"}
    event.value=a

    Found my problem.  Was using different subforms without including in the formula.

  • Difficulty in setting value of a field at runtime

    I have a form with input text fields. One of the fields is disabled and automatically filled by the system. I am having problem filling this field at runtime.
    What I did was that I tried to set the value of the field during the save operation (that is when I clicked on the save button). The system sets the value of the field but it did not commit the value into the table. This is is the code that I used
        public String SaveParameterRecord() {
           this.codeTypeId.setValue("GB011");
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Commit");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
    Again I tried with with method call, but it gave me java.lang.NullPointerException at the point (this.codeTypeId.setValue("GB011"))
        public String CheckParameterMethod() {
             BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
             this.codeTypeId.setValue("GB011");  
            return null;

    hi Frank,
    The issue I see is that by putting this.codeTypeId.setValue("GB011"); wont be updating the model, and that is why after your commit, the value comes null. Is that variable depending on any other value? If you really want to update the model at that stage you will need to do something like;
      public static void setExpressionValue(String expression, Object newValue) {
          FacesContext facesContext = getFacesContext();
          Application app = facesContext.getApplication();
          ExpressionFactory elFactory = app.getExpressionFactory();
          ELContext elContext = facesContext.getELContext();
          ValueExpression valueExp =
              elFactory.createValueExpression(elContext, expression,
                                              Object.class);
          //Check that the input newValue can be cast to the property type
          //expected by the managed bean.
          //If the managed Bean expects a primitive we rely on Auto-Unboxing
          Class bindClass = valueExp.getType(elContext);
          if (bindClass.isPrimitive() || bindClass.isInstance(newValue)) {
              valueExp.setValue(elContext, newValue);
    And then instead using this.codeTypeId.setValue("GB011"); you will call setExpressionValue("#{bindings.yourVariable.inputValue}","GB011"). But then again I dont recommend you doing this.
    If this variable depends on another variable, you can use a setPropertyListener and autoSubmit=true.
    Regards

Maybe you are looking for

  • Error message while trying to run combo update

    I get the following error message when trying to run the combo update. "You cannot install Mac OS X Update Combined on this volume. This volume does not meet the requirements for this update." I tried with both 10.5.7 and 10.5.8 and I get the same me

  • Why can't I make a project progressive?

    When I open a new project in Encore, I want to set it to progressive. But no matter what I try, the Video Transcoding settings are greyed out and I can't change it from Lower Fields First. This has left me with jumpy videos, and I have no idea how to

  • Typing on a Circular Path in CS6

    I've found lots of tutorials, but all of them leave me in the dust. Most seem to be for versions earlier than CS6, or they omit an important step or mention some function I can't find. Anyway, can someone tell me what steps to follow in order to the

  • [SOLVED] Error with taskset

    I'm trying to assign a process to one core of my machine using taskset. But it gives me this error: $ sudo taskset 0x00000001 -p 20145 Password: execvp: No such file or directory failed to execute -p What do I have to do to make it work? Thanks Last

  • Novoice to BI

    Hi Friends, I am new to BI and tell me what are the areas i should focus.  what are the advancement in these areas? what s the scope of this BI? thanks in advance