How to modify values of a textbox based on a checkbox

Where can I find a guide to creating custom JavaScipt calculation code for Adobe Acrobat fillable forms?
I have a fillable form that will base a textbox value on the following:
value = 0.00;
if checkbox1 is checked, then:
  value = value + 3.60;
end if
if checkbox2 is checked, then:
  value = value + 0.90;
end if
if textbox4 has any number in it, then:
  value = value * the number in textbox4;
end if
if value is NaN, then:
  value = 0.00;
end if
if value is 0.00, then:
  make textbox blank (clear the textbox)
end if
how do I do this in "custom calculation script" JavaScript?
I tried to implement it, but the code gave an error when I tried to add to event.value a second time:
event.value = 0;
event.value = event.value + 3.60; // works
event.value = event.value + 0.90; // doesn't work
I don't understand. Why would it work on one but not the other?

"event.value" is a string. I suggest you work with another variable (a
number) and at the very end apply the value of that variable to event.value.
A good place to start learning about calculations is here:
http://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations

Similar Messages

  • Passing DB values to the textbox based on Select Value item

    Hi,
    I am very much new to the Oracle APEX. In my project, I have a requirement wherein I have to pass the different values to the corresponding textboxes on a different page based on the value I select from the "Select Value" item.
    I have tried using calling On-Demand Processes, but couldn't get the desired result.
    Please suggest!

    Hi 796444 ,
    Welcome to the forum. It will be good if you familiarize yourself with the forum ettiquittes. Also, when posting always state the following:
    a. Apex version
    b. DB version
    c. Web server ; EPG, apexlistener, etc
    d. Provide adequate details for others to understand your problem / what you are trying to achieve.
    e. Any code snippets you post should be enclosed in a pair of tags
    If your current problem is that the you are *calling* Page 2 from Page 1, and while doing so you want the value of P1_ITEM1 to be passed and set in p2_ITEM1 then
    a. Edit the branch
    b. In Action in Set these items write P2_ITEM1
    c. In With these values write &P1_ITEM1. (do not miss the dot at the end)
    It looks good if you use a better handle than 796444 :-)
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to refresh values in second messagechoice based on first messagechoice?

    Hi All,
    We had a requirement where we need to populate values into second messagechoice item based on the value selected in the first messagechoice item.
    We need to take the value (first messagechoice) as output parameter and need to pass as input parameter to the second messagechoice VO.
    Can any please help me how to achieve the above.
    Regards,
    Sundeep

    Hi Sumit,
    Thanks for the reponse. I will go for the one you suggested.
    Can you please go through my new thread if you have time which is a very urgent requirement for me.
    Thread subject: "How to change VO's dynamically for a item for each row in advanced table?"
    Regards,
    Sundeep.

  • How to display value of an item based on another item

    Hi,
    In a page I've to display name for the corresponding id displayed in id item.Can I write a query based on id and display name as soon as I enter into that item.if so are there any properties I need to set ?I'm looking for just post_text_item functionality in forms?
    Thanks,
    Mahender

    Hi,
    I've created sample table with id,first_name and last_name to test:
    I've created AJAX script in application process area with name GET_NAME
    declare
    v_name varchar2(150);
    begin
    select first_name||'-'||last_name into v_name from names
    where id = :P53_id;
    htp.prn(v_name);
    exception when others then htp.prn('An error occurred retrieving name'||sqlerrm);
    end;
    CREATED JAVA SCRIPT IN html headers section of the page p53:
    <script type="text/javascript">
    function get_name(){
    var id = document.getElementById('P53_id').value;
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value, 'APPLICATION_PROCESS=GET_NAME’,0);
    get.add('P53_id',id);
    var gReturn = get.get();
    document.getElementById('P53_name').value = gReturn;
    </script>
    put the following in HTML Form Element Attributes of p53_id :
    onchange="get_name(this,'P53_id)"
    It's not working ?
    Can anyone help
    Thanks
    Edited by: user518071 on Aug 14, 2009 8:14 AM
    Edited by: user518071 on Aug 14, 2009 11:04 AM
    Edited by: user518071 on Aug 15, 2009 5:02 AM

  • How to get value from a metric based on date, without effecting other colum

    Hi
    I have 2 metrics say Revenue and Total Revenue and Date Dim
    For a selected date in the prompt, Revenue should be shown for that date, where as Total Revenue should be shown for the past 15 days, based on the date in the prompt.
    How can I achieve this?
    Cheers
    Edited by: OBIAS on Feb 28, 2013 4:57 PM

    Set a presentation variable in the Date Dim prompt, P_DATE.
    Within the request, edit the formula for Revenue to be...
    FILTER("Revenue" USING ("Date" = @{P_DATE}))
    And set the formula for Total Revenue to be something like...
    FILTER("Total Revenue" USING ("Date" between TimestampAdd(SQL_TSI_DAY, -15, @{P_DATE}) and @{P_DATE}))
    JB

  • How to populate values in F4 help based on another F4 help in a TMG

    Hello All,
    I have created a TMG for a table. Have added that to customization also. Now, in that table I have 2 fields say carrid and connid. In the F4 help of carrid, all carrids will be displayed. Now if the user selects one carrid, the next field connid should show only those connids related to carrid. How this can be achieved in a TMG. If in a module pool, we can write POV or etc. But in TMG, how can we ?
    Rgds,
    Renjith

    See the table maintaince has events ,you can write the code under events.
    Reward Points if it is helpful
    Thanks
    Seshu

  • How to restrict values in one prompt based on value from another prompt

    Hi
           I have a requirement as follows. I have two fields (objects)
    program code
    contract number
    one program code can have several contract numbers.
    I need to provide prompts on Program code and contract number. when user selects one program from the prompt on program code then contract field should only show contract numbers belonging the program user selected.
    Please let me know how to bring this functionality in Webi report.
    Thanks in advance.

    Hi
    if ur requirement is in query level its impossible.(i mean whn u click on programcode then u have to display in contract at query level)
    if you want to display at report level then  
    The two objects Program and contract have a mapping then place a program object in query filter and use operator equal to and select prompt and run the query then it will ask you to select program .whn on choosing it you will  get filtered contract numbers for that program in report level  . There no need to use prompt for contract numbers object .
    Hope this helps u
    Thanks
    sunil
    Edited by: K.sunil on Nov 7, 2011 9:30 AM

  • How to merge values in a row, based on distinct values in another column

    I have a table like
    updatedby updateddate text
    John 01-May-2009 Approval record 1 added
    John 01-May-2009 Approval record 2 added
    David 02-May-2009 Approval record 1 removed
    I need the values of text column to be concatenated and displayed for unique records of (updatedby updateddate). The output is something like
    updatedby updateddate text
    John 01-May-2009 Approval record 1 added, Approval record 2 added
    David 02-May-2009 Approval record 1 removed
    I had planned to do it using PLSQL. Is there a way to get this done by SQl?.. Kindly suggest

    Prior to 10g:
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn,
                     count(*) over(partition by updatedby,updateddate) cnt
               from  t
      where rn = cnt
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updateddate,
               updatedby
    UPDAT UPDATEDDA TEXT
    John  01-MAY-09 Approval record 1 added,Approval record 2 added
    David 02-MAY-09 Approval record 1 removed
    SQL> 10g and up:
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn
               from  t
      where connect_by_isleaf = 1
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updatedby,
               updateddate
    with t as (
               select 'John' updatedby,to_date('01-May-2009','dd-mon-yyyy') updateddate,'Approval record 1 added' text from dual union all
               select 'John',to_date('01-May-2009','dd-mon-yyyy'),'Approval record 2 added' from dual union all
               select 'David',to_date('02-May-2009','dd-mon-yyyy'),'Approval record 1 removed' from dual
    select  updatedby,
            updateddate,
            ltrim(sys_connect_by_path(text,','),',') text
      from  (
             select  t.*,
                     row_number() over(partition by updatedby,updateddate order by text) rn
               from  t
      where connect_by_isleaf = 1
      start with rn = 1
      connect by updatedby = prior updatedby
             and updateddate = prior updateddate
             and rn = prior rn + 1
      order by updateddate,
               updatedby
    UPDAT UPDATEDDA TEXT
    John  01-MAY-09 Approval record 1 added,Approval record 2 added
    David 02-MAY-09 Approval record 1 removed
    SQL> SY.

  • How to make alternate GL account mandatory based on enable checkbox?

    Hi,
    I need to do a personalization on gl code combination form such that it makes alternate gl code combination field mandatory for a gl code combination which is disabled by user. So it must not allow to disable any gl code combination without entering alternate gl code combination.
    trigger event : WHEN-VALIDATE-RECORD
    trigger object : COMBO
    condition : :COMBO.ENABLED_FLAG = 'N' AND :COMBO.ALTERNATE_ACCOUNT_FLEXFIELD IS NULL
    Actions
    1) property -> item -> COMBO.ALTERNATE_ACCOUNT_FLEXFIELD -> REQUIRED -> true
    2) message -> error -> Alternate account must be compulsory when disabling any account.
    I've tried above form personalization but it is not working. also tried custom.pll but this even does not work on this form. Can anybody suggest how I can achieve this requirement without doing any customization?
    Thanks in advance.....
    SANJAY
    Edited by: sanjaypanchal on 25-May-2012 04:04
    Edited by: sanjaypanchal on May 25, 2012 4:41 PM
    Edited by: sanjaypanchal on May 25, 2012 4:42 PM

    Okay, looks like you are doing Internet Expenses, correct? Look at the profile options for each employee in Oracle System Administration. Profile option "PA: Allows Project Time and Expense Entry" would be set = "Yes" to allow project expense entry. I assume that is done, since you can see the fields to enter project information. Next, look at profile option "OIE: Enable Projects". That profile option should be set = "Required", for what you are wanting to do. I am thinking maybe that is set to "Yes". So I would look at those profile options first. You may be making this harder work than it needs to be. Make sense?
    John Dickey

  • How to change values in the form?

    Hi guys,
    I am working on a small JSP project. I have a form in a page. It has several textboxes getting inputs from the user. In the JSP code, I want to change the value of the textbox based on the some condition in the JSP code:
    <form ... action="the same page">
    <input type="text name="theTextBox" value="" ...>
    <%
    if (javaObject.changeTextMethod() == true)
    //I want to change the value of the textbox to something else here, I can't say theTextBox.value="whatever"
    %>
    If I create a form again, I have to write the same code many times. Is there anyway that I can reuse the form code and just change the values of the textbox?
    Thanks in advance!
    ~Ji

    Hi,
    Thanks!
    But when I try javascript. It seems in JSP code, the javacript function cannot be seen.
    <SCRIPT language=javascript>
    function change()
         tBoxName.value="newValue";
    </SCRIPT>
    <%
    if (condtion == true)
    change(); // The error is: change() is not defined.
    %>
    Also, if the textbox is insice <form> </form>, in javascript function, the textbox cannot be seen either. Would you please tell me how exactly to use javascript in this situation? Thanks a lot!
    ~Ji

  • Get values in dropdown field based on f4 help in another field

    Hi Experts,
    How to Get values in dropdown field based on another field which is F4 Help. If I select one value in f4 help field(ex: 1) I need to get values in dropdown field (ex:a, b, c),If I select another value in f4 help (ex:2) I need to populate different values (ex: d). Can any one please provide sample code that can help more.
    Thanks,
    Ashok.
    Moderation: Kindly search and find the solution, before you post.

    Dear Ashok,
    You can take help from this program in SAP named BCALV_EDIT_08.
    Thanks.
    With regards.

  • Modify Values Document Category List

    Hi All,
    Can you please explain how to modify values or add new ones to the Document Category list, that belongs to the manage contract documents Actions?
    I am working on OM > Blanket Sales Agreement >
    Thanks for your help
    Deneb

    What exactly do you need, just a list of categories applied on a document or something more? Here is a basic AttributeRequest for getting category info from document:
            AttributeRequest[] catAR = new AttributeRequest[]
              new AttributeRequest(Attributes.CATEGORIES, new AttributeRequest[]{
                new AttributeRequest(Attributes.CATEGORY_CLASS_OBJECT, new AttributeRequest[]{
                  new AttributeRequest(Attributes.DISPLAY_NAME, null)
                new AttributeRequest(Attributes.CUSTOM_ALL, null)
        Item file = fm.resolvePath(filePath, catAR);
        NamedValue[] categories = file.getRequestedAttributes();
        Item[] categoryInstances = (Item[])categories[0].getValue(); //index [0] is for Attributes.CATEGORIESthen you cycle through categoryInstances to get each category's display name.... Hope this helps, if you have any other questions - ask and I will try to give you the answer!
    Pedja

  • How can I select and delete rows based on the value in one column?

    I searched through the discussion board, and found a thread on deleting blank rows, but not sure how to modify it to work with my issue.
    I have put together a rather complicated spreadsheet for designing control systems, it calculates parts needed based on check boxes selected in a second spreadsheet.
    Since not all systems require all parts there are many rows that have a 0 quantity value, I would like to select these rows and delete them once I have gone through the design phase (checking off required features on a separate sheet).
    I like the way the other thread I found will gather all the blank rows at the bottom without changing the order of the rows with data in them.
    I don't understand exactly how the formula in the other thread works well enough to modify it to look for a certain column.
    I hope I made myself clear enough here, to recap, I would like to sort the rows based on a zero value in one (quantity) column, move them (the zero quantity rows) to the bottom of the sheet, and then delete the rows with a zero quantity (I can delete them manually, but would like to automate the sorting part).
    Thanks for any help anyone can provide here.
    Danny

    I apologize but, as far as I know, Numbers wasn't designed by Ian Flemming.
    There is no "this column will be auto-destructing after two minutes"
    You will have to use your fingers to delete it.
    I wish to add a last comment :
    if your boss has the bad habit to look over your shoulder, it's time to find an other one.
    As I am really pig headed, it's what I did. I became my own boss so nobody looked over my shoulder.
    Yvan KOENIG (VALLAURIS, France) mercredi 13 juillet 2011 20:30:25
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to "force" user to enter a valid value in a TextBox

    How can one create a TextBox in which the user is not able to leave (commit the value, change focus, or perform the action of another control) unless a valid value (the value to be committed) is displayed?
    The following is the best I've come up with so far.
    Good: It doesn't permit a value to be committed unless it is valid.
    Good: It doesn't permit the focus to be changed when TAB is pressed unless it is valid.
    Bad: It permits the user to perform the action associated with a button at any time.
    In the following code pressing on the button prints "I've been pushed", no matter the value of the TextBoxes. Can I stop this (in general, not for specific buttons)?
    class ValidTextBox extends TextBox {
      public-init var validValue:String = "";
      function isValid():Boolean {
        return (rawText == validValue);
      var isFocused = bind focused on replace {
        if (not focused and not isValid()) {
          requestFocus();
      override function commit():Void {
        if (isValid()) { super.commit(); }
        else {};
    var string1:String = "" on replace { println ("String1 = '{string1}'") };
    var string2:String = "" on replace { println ("String2 = '{string2}'") };
    def textbox1 = ValidTextBox { text: bind string1 with inverse; promptText: "String1: enter abc"; columns: 20; validValue: "abc"; }
    def textbox2 = ValidTextBox { text: bind string2 with inverse; promptText: "String2: enter def"; columns: 20; validValue: "def"; }
    def aButton = Button {
      text: "Push me";
      action: function():Void { println("I've been pushed!"); }
    Stage {
      scene: Scene {
        width: 250
        height: 300
        content: [ VBox { spacing: 10; content: [ textbox1, textbox2, aButton ] } ]
    }

    It sounds like you are looking for a concept of validation that groups items together. In days long gone Oracle used to have a product called Oracle Forms - that had field validation, record validation and block validation. So in your example if string1 and string2 were in the same persistable data object then the equivalent concept would be 'record validation'. The code in your button would say "if the record is valid print". A record is only valid if all its fields are valid.
    JavaFX really provides a 'GUI toolkit'. I think you are looking for a fairly advanced binding framework - a framework that builds on the concept of field level validation. You can approximate such a thing by creating a 'validation group' class. This class would be able to have nodes added to it and have an 'isValid()' function which only returns true if all the node items are valid.

  • How to find bpel instance in 11g based on the index values

    We have 10g BPEL process where we define 4 index values for all the instances. Whenever support request comes, we ask index values and based on that we search the process instance.
    We have migrated this 10g bpel process to 11g now. How to find bpel instance in 11g based on the index values ???

    I have multiple bpel in my composite. I checked in ci_indexes table and it shows the instance number of the bpel process. But the em console is showing only the composite instance number. when I opened composite instance, I could see all the bpel process with instance number in the audit trail. How can I find the the actual composite instance number that I should search for in the em console ???

Maybe you are looking for