Fill in the text field when TWO radio button is unchecked

Hello

I don't know anything about javascript and need help.  I have a photography contract I want to offer a "discount package" of $50 when the two services will be used.  1 service is 'Photography coverage' and Service 2 'Photo Booth Rental'.

Text field 1 = subtotal (calculates the values of checkbox and radio button)

Text field 2 = discount (it's where I need help.  I would like this automatically filled with $50 when my default two boxes are not selected.  But only when the TWO are not selected)

Text field 3 = Total (which has a basic calculation of the Subtotal-Discount)

The services of two by default (it's done on purpose, I checked from the beginning) are both set to the '0' values to keep the subtotal $ 0.  If the client will use a service (which means one of the default selections will be selected), then there will be no discount, but if they decide to use photography and the cabin, they save $50.

Can someone please help me to write a script for the text field, Discount calculation, to accomplish what I ask?

Untitled-3.jpg

You can use something like what the calculation script custom field discount:

Event.Value = (this.getField("Service1").value == 0 | this.getField("Service2").value == 0)? 0: 50;

Simply adjust the field names in the code to match the real in your file.

Tags: Acrobat

Similar Questions

  • Drop-down lists of the fill of the text fields on a different page from the drop-down list.

    Hi all

    I have a form with multiple pages. The first page contains a number of drop-down lists. These lists, drop-down list when the option is chosen, must complete a field text on another page. I can get the drop down menu to populate the text field when it is on the same page, but as soon as I move the text field to another page, the script does not work. Can anyone offer a solution? I used javascript on the changes to the scripts.

    Every time reference you the other object... so I guess in the code located on the DDlist.

    Paul

  • fill in the text field by clicking on another link on the page

    I have two pages. When I click on the link on the first page, it fill the text field on the second page (pull out the 'from' value). My first page abc.php codes:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head>  <body> <p><strong>From</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp;Subject</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>Reply</strong></p> <p>biri&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;deneme girdi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">click</a></p> </body> </html>

    and this is the second page lumu.php:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head>  <body> <form id="form1" name="form1" method="post" action=""> <label> <input type="text" name="hum" id="hum" /> </label> </form> </body> </html>

    What should I do?

    I thought about it. Thank you.

  • fill in the text field with the caption for the radio list

    Hi, I'm looking for an answer to this all morning.  I need to use the value of a list of radio to populate a text field.  I can get the selected numeric value OK with

    $.rawValue = form1. #subform [0]. . Table3.Row1 #SubForm [0]. . RawValue location [0]

    but I want to get the text associated with the value element.  This could be the legend of the selected option button, since it is the same thing.  I don't want to use an if statement because I have a lot of forms to create and that would change things a few times in each shape.  How can I get the value of the text of the column of the item below?

    screenshot.17.png

    Try the following with two modifications to your hierarchy.

    (1) currently, you do not have a name for Page1. Make sure that you assign a name for ease of use. ("Page1").

    (2) define a name for the subform that contains PeriodRadio. ("Subform1").

    $.rawValue = form1. Page1. Table3.row2. Subform1. PeriodRadio.selectedMember (). caption.value.text.value;

    Thank you

    Srini

  • Fill in the text fields of the select list

    I have a select list when selected will fill two text fields with values based on the SQL query

    For example. The selection list is for empno and meets ename and sal in two different fields.

    I looked at the example of the Dene http://htmldb.oracle.com/pls/otn/f?p=31517:42 it's very good, but the only problem I do face is how to fill in several fields.

    Any help will be appreciated.

    ZRH

    Hello

    It would depend where SAL data. If it's on your page, then you could probably do something with javascript. If this isn't the case, you will need to do some Ajax to retrieve the value of the database. Take a look on: http://htmldb.oracle.com/pls/otn/f?p=31517:80

    Your select list can include the ENAME and SAL and your javascript values existing would then just divide the data into two parts and insert them into the appropriate fields.

    Andy

  • Fill in the text field

    Hello

    I have a drop down that is filled from one selection of another menu drop down menu using the addItem script. This new drop-down menu will have only two values.

    Is it possible for a text field is filled with the "unselected" value in the menu drop-down?

    I have attached the document here. Text fields will replace the A - G labeled drop-down lists on the lower part of the doc.

    Joe

    Hello

    I changed the "A" in a drop-down list of a textfield and changed the SOM in the script.

    The main search script is in DropDownList4.

    I moved your script addItem event entry in the preOpen event, which is better to fill drop-down lists. Also have a look at the script, because I put these two addItems, 0 and 1 values.  This means that the user sees the team names, but the script can then reference the bound values.

    The new script is in the case of release of the first game. It looks like the value of the selected item in the drop-down list and then fills the 'A' with the other name for the teams.

    if (this.selectedIndex == "0")
    {
         TextField15.rawValue = this.getDisplayItem(1);
    }
    else
    {
         TextField15.rawValue = this.getDisplayItem(0);
    }
    

    I have the first fact, you should be able to follow for others.

    Good luck

    Niall

  • Fill in the text field of the value of select list using javascript

    Hello

    I'm editing a form where a text field is to be filled using an On-Demand application process. The process is called with an OnChange.

    Application process:
    declare
      l_CCSS_STATUS varchar2(100);
    begin
      select CCSS_STATUS into l_CCSS_STATUS from PATIENT
        where ID = :P11_PATIENT_ID;
      htp.prn(l_CCSS_STATUS);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    l_CCSS_STATUS := 'Inactive';
      htp.prn(l_CCSS_STATUS);
    end;
    In the attributes of HTML Form selection list element:

    onChange = "javascript:f_getStatus()"; "

    It fills a text field (: P11_CCSS_STATUS) when I appreciate is selected in the select list.


    I am filling a second field (: P11_COPY) with a (share) value for the same table of PATIENTS, but don't really understand how the: P11_CCSS_STATUS field is filled in from the application process.

    If I understand the request of the share in the application process, then it is appended to the value CCSS_STATUS and appears in the: P11_CCSS_STATUS text element.

    Any help is appreciated.

    Thank you
    Matt

    Hello

    visit the similar to the below application process

    declare
      l_CCSS_STATUS varchar2(100);
      l_COPAY varchar2(100)
    begin
    
      select CCSS_STATUS , COPAY into l_CCSS_STATUS , l_COPAY from PATIENT
        where ID = :P11_PATIENT_ID;
      //notice this line.... how the response is send
      htp.prn(l_CCSS_STATUS || ',' || l_COPAY);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    l_CCSS_STATUS := 'Inactive';
      htp.prn(l_CCSS_STATUS);
    end;
    

    and javascript call you to something similar to below.

    function myAjaxCall()
    {
       var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=myAppProcess',0);
       ajaxRequest.add('P11_PATIENT_ID' , $v('P11_PATIENT_ID'))
       //notice the below line.. use of split function
        ajaxResult = ajaxRequest.get().split(',')
       $s( 'P11_CCSS_STATUS' , ajaxResult[0]);
          $s( 'P11_COPAY' , ajaxResult[1]);
    }
    

    Example: http://apex.oracle.com/pls/apex/f?p=12060:110

    Kind regards
    Shijesh

  • JavaScript - fill out the text field with data entered

    Hello

    I am learning javascript and need help to put in place a script that will do the following:

    I have three text fields where users enter data. I would like to take this data and provide a summary in a 4th text field. If a field is null, it should be ignored.

    TextField1

    textfield2

    textfield3

    Summary data entered above must be posted in textfield4.

    Text1

    Text2

    Text3

    Your help would be much appreciated.

    Thank you!

    Varns

    Hello

    On the calculate event of the textfield4 put the following text (or something like that):

    var str1 = "";

    var str2 = "";

    var str3 = "";

    var str4 = "";

    If (TextField1.rawValue! = null)

    {

    str1 = TextField1.rawValue + "\u000a";

    }

    If (TextField2.rawValue! = null)

    {

    str2 = TextField2.rawValue + "\u000a";

    }

    If (TextField3.rawValue! = null)

    {

    str3 = TextField3.rawValue;

    }

    STR4 = str1, str2 + str3;

    If (str4 > "")
    {
    this.rawValue = str4;
    }
    on the other
    {
    this.rawValue = "";
    }

    You may need to adjust to your exact needs - good luck!

    Stephen

  • fill in the selected field of text based on the value of lov

    Hello
    Depending on the value selected in lov, I want to fill another text field. Here is the code I wrote

    Of the PFR:

    If (PageContext.isLovEvent ())
    {
    String lovInputSourceId = pageContext.getParameter (SOURCE_PARAM);
    If ("lovCategory".equals (lovInputSourceId))
    {
    java.util.Hashtable lovResults = pageContext.getLovResultsFromSession (lovInputSourceId);
    if(lovResults!=null)
    {
    = (String) lovResults.get ("lovCategory"); value string
    amobj.categorycode (value);

    }
    }
    }

    Code AMImpl:


    {} public void categorycode (string code)
    sundryCodeVOImpl vobj = getsundryCodeVO1();
    vobj.setWhereClause ("lookup_code =" + "'" + code + "'" ' ");
    vobj. Reset();
    vobj.executeQuery ();

    String desc = vobj.first ().getAttribute("Description").toString ();
    String attr = vobj.first ().getAttribute("Attribute1").toString ();

    testEOViewImpl vobj1 = gettestEOView1();
    vobj1. GetCurrentRow () .setAttribute ("CodeDescription", DESC);
    vobj1. GetCurrentRow () .setAttribute ("PurchasingCategoryCd", attr);
    vobj1. ExecuteQuery();
    }

    With this code, updates to the code attributes, PurchasingCategoryCd values get inserted in the database table, but they now appear in the text fields when a value is selected in lov.

    Please tell me what is the error that I do.


    Thank you
    Sunny

    Hi sunny

    Going through the thread, it seems that the application of LOV VO has three columns viz A, B and C. You want to put the value of the B column to a text field, if this is the case. Simply create a LOV mapping for column B.

    Also I suggest you take a messagestyledtext for the B field as value comes form LOV himself.

    Thank you
    AJ

  • NULL text field, how to fill in another text field

    I would like to be able to invite the user to fill one of two text fields, if for example they fill in A text field, then no guest would jump to the top, but if they don't fill in the text field then a prompt would leap upward by asking them to fill out the text field B.

    Thank you

    Hello

    One way would be to place a JavaScript in the output of TextFieldA event:

    if (this.rawValue === null) {
         xfa.host.messageBox("Please complete Text Field B", "Attention", 0, 0);
    }
    

    However this fires when the user leaves TextFieldA. You may need extra script if it is likely that the user is not yet in this text field.

    Niall

  • Tips: APEX 5 r IR by a dynamic action after the text fields complete

    Hello I hope I can get assistance on this matter and thank you in advance for any information.

    I have an APEX 5 screen, that has 4 fields of entry of text and under this one IR that has these 4 parameters in its SQL where clauses.

    Now if I create a button that submits page or redirects to this page my report can be updated with the values of user entered without problem, basic stuff.  If I create the settings section as a dialog box model once again that I can get the update report as this dialogue submits the page as well as the report can refresh according to closed dialog option.

    What I struggle to reach is to allow the user to enter values in the text fields click on a button called 'submit' and there all stages of implementing dynamic action without page reloading.  I want user to P1_A, P1_B, P1_C, P1_D press on "submit" input, dynamic action that links the values entered into the fields, then fire another dynamic action that updates the State when the button is clicked / modified values what works the best.

    I am struggling to get this to work and I even tried to copy these settings and do them as hidden for example bind input P1_A to P1_A_Hidden by a dynamic action and have the report where clause =: P1_A_HIDDEN, but have not managed to get this working.

    It's possible?  I know its easy to simply send the page and make it work, but I want the experience to be quite uniform for the user and act as you never leave the page.

    I saw on the packages of the app in the chart example.  The bubble chart has a list selector (salary) and the table updates dynamically, it seems so that the process can occur, but I need the user to enter text and not use selection lists.

    My apologies if I missed any, but I can give you more if it helps.

    Concerning

    1972903b-5166-494e-8355-08d9d4006e96 wrote:

    Hello I hope I can get assistance on this matter and thank you in advance for any information.

    I have an APEX 5 screen, that has 4 fields of entry of text and under this one IR that has these 4 parameters in its SQL where clauses.

    What I struggle to reach is to allow the user to enter values in the text fields click on a button called 'submit' and there all stages of implementing dynamic action without page reloading.  I want user to P1_A, P1_B, P1_C, P1_D press on "submit" input, dynamic action that links the values entered into the fields, then fire another dynamic action that updates the State when the button is clicked / modified values what works the best.

    The button simply trigger a unique dynamic action of refreshment on the IR region. Session state for page elements must be processed automatically by specifying them in the property Page to submit Items of the IR region.

    Please ensure that you have updated your forum profile with a recognizable username instead of "1972903b-5166-494e-8355-08d9d4006e96": Video tutorial how to change username available

  • Shrink the text field

    Hi all

    I have a problem with my textfields in Livecycle. My goal is to have a text field of a certain size that can expand to accommodate more text or reduced to fit the text that does not have full space that offers the text field. I put my height of the text field to display everything and wrote a javascript statement to minimize the size of the text box to fit all text entered. The code is as follows and is in the output of the field event:

    If ((this.resolveNode("$").rawValue! = null & & this.resolveNode("$").rawValue! = "") & & this.resolveNode("$").rawValue! = "Enter text here.") {

    this.resolveNode("$").border.presence = 'hidden ';

    this.resolveNode("$").h = "";

    }

    EC that it is supposed to do, is to minimize the height of the text field when the user leaves the field so that the field corresponds to the amount of text (there is a default value on the field "Enter text here."). Everything works perfectly and the field will develop and adjust the text, however when the form is saved and then re-opened, the text field is reduced to an incredibly small size so that only the first line of the text is visible and it is cut in half.

    I suspect that the problem comes from the fact that the script I've written sets the height of an empty value, but it is only in the case of output, so the size of the field should not change from when the form is saved to when it is open. Does anyone have ideas for how to fix this?

    Replace this.resolveNode("$").h = "' with this.minH =".01in ".

    Also, this.resolveNode("$") is the same as just 'this' (as I know).

    Kyle

  • buttons radio and the presence of the text field

    New on LC and JavaScript and tries to show/hide a text field on radio button (outside the Group), select by using the presence property. Two buttons in the exclusion group (I'll call them 1 and 2), by default the text field presence should be hidden (not displayed and not take place on the layout).  I have set the default value for the '2' radio button group and want the text field to display (and have the focus, but I got this little) when the value changes to '1' to the click, then disable and hide again if you click on '2 '.  Any advice would be greatly appreciated.

    Thanks in advance.

    You can use this script to the click event of the exclusion group:

    Form1. #subform [0]. RBL::click - (JavaScript, client)

    If (this.rawValue is '1')
    {
    TextField1.presence = "visible";
    }
    on the other
    {
    TextField1.presence = 'hidden ';
    }

    Who should do it, because rb1 has value 1, and rb2 has a value of 2. RBL is exclusion group.

  • Turn off the text field (always submits page when you press enter)

    I have an area which allows you to enter search criteria. There are two fields and a button. The 1st field is a selection list that gives a list of columns in a database that can be searched on. The 2nd field is where the user enters the value to search for. The user can submit the search in 2 ways. They can press the button or press return when the cursor is in the 2nd item that is a text field (always submits page when you press enter). The results are then displayed in a region of report below.

    The problem I have, is that if the request is for > 10 seconds and the user gets impatient and hits the Enter key or the button search again the query is returned for a second time (or third or fourth according to the impatience of the user) causing the claim on the basis of data with a negative impact on the performance of the system.

    I know how to handle the search key. On a click event on I turn off the button so that the user cannot click on it again and resubmit the request.

    My question is - how can I turn off "always provides a page when you press enter" text item when the user presses enter? I tried an onclick event, but disabled the front element I could type in anything. Onblur event does not seem to do anything.

    Any ideas would be very appreciated.

    Andy

    Hello

    First of all, one thing to try: attributes of the Page, there is a section for the presentation in double - try setting this option on no.

    Otherwise, using the text field type, adds the following to the INPUT tag:

    onkeypress="return submitEnter(this,event)"
    

    which means, you can call your own function of javascript on the onkeypress event, the final line would be call submitEnter(). But you can set the value of a hidden page element:

    function doEnter(t, e)
    {
     if ($x('P1_SEARCH_RUNNING').value == 0)
     {
      $x('P1_SEARCH_RUNNING').value = 1;
      return submitEnter(t, e);
     }
     else
     {
      return false;
     }
    }
    

    Then, after changing your element to an element of normal text on the attributes of HTML form elements, add in:

    onkeypress="return doEnter(this,event)"
    

    Andy

  • How to programmatically launch touch sceen keyboard, when the user clicks on the text field for application?

    Hello

    I create a desktop using the CreateDesktop() API, in this office, I launched a MFC dialog with text field box in this topic.

    I want to get the keyboard touch screen when I touch on the text field of the dialog box.

    I tried to use the following information

    https://msdn.Microsoft.com/en-us/library/Windows/desktop/dd371581%28V=vs.85%29.aspx

    but the key Board launched when I touch the dialogue instead of text field.

    Please give me the solution?

    Pramod Hello,

    Thanks for posting your question on the Microsoft community.

    This question fits better to the developers on MSDN forums.

    I would recommend posting your question on the MSDN forums.

    MSDN forum
    https://social.msdn.Microsoft.com/forums/en-us/home?category=windowsdesktopdev

    Thank you

Maybe you are looking for