Make check box activate a calculation

Hello I have a question about forms and calculations.  I have the following problem.  I have a grand total which is setup to sum my fees column.  It works fine.  My fees column is multi line.  I had it setup to calculate hours multiplied by hours worked and put it in my fees column.  I only want the calculation to be dependent on whether or not my check boxes are checked.  If they are not checked then I do not want the calculation to happen.  I can't get this to work for me.  Is it possible?  Thanks for any help fellas!

If that is your fill script, you first need to obtain the values of the field objects.
// obtain the value for the field objects:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
Once you have established the values you can test and use them. The
'if (statement) {
// block of code
} else {
// block of code
does not return a value. The '(statement)? {true answer code} : {false answer};' variation is used to return a value. So your final code can be:
// obtain the value for the field objects:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
// test the value of the check box
if (C1 == 'Yes')
event.value = HR * HR2;
else
event.value = 0;
or
// obtain the value for the field objects:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
// set the value based on the value of the check box
event.value = C1 == 'Yes'? HR * HR2 : 0;
But if you set the export value to '1', then your script can be:
var C1= this.getField('C1').value;
var HR= this.getField('HR').value;
var HR2 = this.getField('HR2').value;
// compute value from HR, HR2, and logical value of C1 not being Not a Number
event.value = HR * HR2 * !(isNaN(C1));

Similar Messages

  • Make check box disappear

    In a selection screen, how do i make check boxes disappear for a specific tcode.
    does this code work below:
    loop at screen.
    if tcode = ' xyz'.
        if screen-name = 'CHK1'.
           screen-input      = 0.
           screen-invisible  = 1.
           modify screen.
       endif.
    endif.
    endloop.

    Hi,
    you can try this code:
    *specify the parameter of your checkbox.
    PARAMETER : p_check AS CHECKBOX.
    * Event at screen PBO
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-NAME = 'P_CHECK'   "Check the screen name
        AND sy-tcode = 'SE38'.       "Check for your t-code
          screen-invisible = 1.      "if satisfy, set the invisible on
          MODIFY SCREEN.             "and modify the screen properties
        ENDIF.
      ENDLOOP.
    Have a nice try

  • HOW TO MAKE CHECK BOXES EXCLUSIVE IN MULTI ROW BLOCK

    Hi,
    I have a multi row block with one item as check box.It is
    required that at a time only one record can be marked as
    selected through this item. If user marks a record as selected
    the previous selected record should be marked as deselected.
    How i can make these check boxes mutually exclusive ?
    can anybody help me?
    Thanks in Adv
    Sharath.
    null

    SHARATH (guest) wrote:
    : Hi,
    : I have a multi row block with one item as check box.It is
    : required that at a time only one record can be marked as
    : selected through this item. If user marks a record as selected
    : the previous selected record should be marked as deselected.
    : How i can make these check boxes mutually exclusive ?
    : can anybody help me?
    : Thanks in Adv
    : Sharath.
    Hi
    The check box can not be mutually exclusive.
    This is a basic functionality.
    You convert this item type into radio button.
    It will satisfy your requirements.
    Jeya Raman R
    null

  • Make Check Box Input Inactive.

    Hi Friends,
    I had created a check box and make the input off by setting the properties. But when I do this the text label left to the check box also becomes inactive.
    How can I resolve this Problem.
    Thanks in advance.

    hi rakesh,
    Whats there in inactivating a label , anyway you cannot edit a label right.. Even though if you want the label not to be active, remove the inactive in property and in PBO loop the screen and write a if condition to search for screen name .. and you can inactive the screen using screen-active = 0.
    Regards,
    Sivaganesh

  • How to make check box as checked by default thru personalization

    Hi,
    I tried to make the check box to be checked by default, but i can't find the "Initially Checked" property in the personalize page.
    Its not there, only "Initial Value" property available.
    Tell me how to do that by personalization.
    Thanks in advance,
    SAN

    San,
    I don't think through personalization it is possible, may be try extending the controller and get the handle of the item, and set the value in the ProcessRequest.
    Thanks.
    With Regards,
    Kali.
    OSSi

  • How to make check box mandatory.

    Kindly help , how can I make a checkbox UI mandatory and have the corresponding label the mandatory * sign.

    Hi Atanu,
    the documentation doesn't show the required-property for the checkbox. That should explain why the required sign isn't shown.
    But it can simply be added manually:
    label.addStyleClass('sapUiLblReq sapUiLblReqEnd');
    Greets,
    ben

  • JTree - How to make Check box as cell editor?

    Dear Swing developers,
    I am planning to make a editable JTree with each node having a JCheckbox. I am kind of stuck at defining the cell editor, any suggestion?
    thanks
    -jay

    take the answer there :
    http://www.mutualinstrument.com/Easy/FAQ/Tree/tree.html

  • How to make a check box non-updatable through personalization

    Hi All,
    I have a requirement where I need to make check box read only in a case when user select some values from the drop down list box. Is it possible through personalization?
    For example if there is a list box which contains 5 values and for three valuse one check box needs to be make as read only and where as for remaining it can be checked/un-checked.
    Please let me know if this can be acheived through personalization.
    Thanks,
    Sandeep

    If there is some event (e.g. fire partial action) present on selection of any value the drop down, then you can achive this using java script.
    Create a raw text item and in the text property put java script to handle this case.
    For sample java script code refer
    How to set particular segment value of key flex field in Controller
    -Anand

  • Check boxes - default as checked?

    Is there a way to make check boxes default as being checked on a form, with users having to uncheck the box if they do not want the option?
    Win XP, Acrobat Pro 9.4, LC ES 8.2

    Go the object Value properties and set the Default to 'On'.
    Steve

  • How to enable/disable check boxes in a table.

    hi Gurus,
    i am new to webdynpro for abap.
    the problem i have is.
    i have a table with two columns. first one is a check box column and the second one is a value field. the table is populated with data(second field only) upon pressing some button.
    while populating data i want to make check box field/row ticked and disabled when second field row value is 'X' . if not leave the check box row/field enabled and unticked ( if i want i can tick the check box later). hope you guys me. this is sort of urgent. please reply with some code.
    thanks in advance.
    Sree

    Hi
    Issue what i am facing is,i want to display column of CHECKBOXes in my ALV.
    for that i declare atrribute of type CHECKBOX.
    And i write the following code.
    lr_column_settings ?= l_value.
    lt_columns = lr_column_settings->get_columns( ).
    loop over table - in each loop another column can be modified
    LOOP AT lt_columns INTO ls_column.
    IF ls_column-id = 'CHK_BOX'.
    CREATE OBJECT lr_chk_box
    EXPORTING
    checked_fieldname = ls_column-id.
    lr_chk_box->set_read_only( ABAP_FALSE ).
    lr_chk_box->set_read_only_fieldname( 'ALV_FINAL_STATUS' ).
    ls_column-r_column->set_cell_editor( lr_chk_box ).
    even i cant able to get checkbox in my ALV.
    IT is displaying as general field.
    Regards,
    Ravi

  • What is the Short Key,For checking the check box in Data Loader ?

    When i am Transfering the data from a legacy to Oracle Apps DB, Using Data Loader tool.I stuck with an issue his i need to enable the check in a particular form using the data loader,Is there a short key Like Enter( ENT), Save and Proceed(*SP) .. Needed Badly ...
    Thank you ..

    You can be able to enable a check box or disable a check box by using the space bar, you make check box item by navigating using tab and use Space bar *SB.
    try this out
    Regards
    Ramesh Kumar S

  • How to activate the Check box in Purchase Order after Goods Receipt

    Hi All,
    How to activate the check box after Goods receipt of Purchase order in Item view (Goods Receipt is completed).
    Where t make the settings in SPRO.
    Regards,
    Shailendra Hadkar

    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

  • Pliz help me calculation with check box :((

    I want to make a calculation as in the picture attached .. how?
    My first use alc .. I already see the help menu but still does not understand as well ..:
    thanks very much..

    It sounds like you should be using radio-buttons, not check boxes. What should happen if both boxes are checked? Or neither?
    Anyway, this code will do what you want (you will need to change the names of the components and the "on" value of the check boxes to match your settings):
    if (this.getField("CheckBox1").value=="Yes") {
        this.getField("ComboBox").clearItems();
        this.getField("ComboBox").setItems(["A","B","C"]);
    if (this.getField("CheckBox2").value=="Yes") {
        this.getField("ComboBox").clearItems();
        this.getField("ComboBox").setItems(["D","E","F"]);

  • Is there a way to automatically align and make same size of check boxes/ radio-buttons like in the image below?

    I create PDF forms on daily basis for multiple people around but still, I create a table in Word and then manually convert it to PDF. I'm using Acrobat X and then I manually create radio buttons or check boxes in each cell of the table so aligning those buttons or check-boxes in the same line is a problem. I know there would be some solution to this but can anyone guide me to that? Also, making the same size of the radio-buttons of check boxes likewise ? ? ?
    Please see the image above and advise how to align them in the same line and how to make them same size using Acrobat X?
    Your help appreciated.

    You should create these fields using the Place Multiple Fields command, so that they are aligned properly and all the same size. Read about it here:
    http://help.adobe.com/en_US/acrobat/X/pro/using/WS8C2DDC1C-C174-4ad1-893F-B14A1C0289B4.htm l
    Read how to align and distribute fields here:
    http://help.adobe.com/en_US/acrobat/X/pro/using/WS6D2D2BFC-6F69-4a8b-BDE6-8043D7EE240D.htm l

  • Make a check box in LiveCycle with a personal character or image as check mark ( info to share...)

    Hello everybody,
    It makes now several weeks i go trough the different forums to find a way to make the check mark of a check box in LiveCycle with a personal color instead of the default black mark, that seems to be the only option available.
    I saw somebody else with that question, but no answer.
    So i found a work around, that make the check box really flexible.
    Here it is:
    REMEMBER that this will work only with forms saved as dynamic PDF.
    Open a new form in Livecycle.
    1) Open Library panel ( Shift+F12) and select Check Box and put it in the page with the dimension and position you like and select it.
    Open the Object panel ( Shift+F7), select field section and under Caption make it blank. Select Binding Section and under name write in ' CheckBox '. for the rest leave all the section values as they are.
    2) In Library select, in the standard section, the icon for making a text object. Put it in the page and size it to your needs and put it on the top of the CheckBox. Select it.
    In the Object Panel, Draw section and under Presence 'Visible'.
    Open the Font panel ( Shift+F4) and under font section, Font : select the Wingdings font and choose the symbol to use as the mark, under Size : the size you need, under Style: font color you like. If the result of the mark is to your feel, set the object to 'invisible'. Leave all other values as they are.
    Open the Hierarchy panel (Shift+F11), right click on the static object and rename it to ' CheckMarkModel ' .
    For information : changing the text object to an image object let's you use an image for the mark in the checkbox.
    3) In Library, select in the standard section the icon for making a Button. Put it in the page and size it to the CheckBox dimension and put it on the top of the text object. Select it. In the Object panel, under Caption : make it blank, under Appearance : select custom in the drop down list an in the dialog box that comes up set the edges to none and the
    background to none. Leave the rest as it is.
    Open the Hierarchy panel (Shift+F11), right click on the Button object and rename it to ' ClickCheckBoxButton ' .
    Now open the Script Editor (Shift+Ctrl+F5), on the left under Show : select in the list the ' Click ' event, under Language : select JavaScript, copy to the window the following script :
    if (CheckMarkOnOff.rawValue == "0")
    CheckMarkOnOff.rawValue = "1";
    CheckMarkModel.presence = "visible";
    else if (CheckMarkOnOff.rawValue == "1")
    CheckMarkModel.presence = "invisible";
    CheckMarkOnOff.rawValue = "0";
    4)Now put in the page an other Check Box, put it on the top of the Button object and select it. In the Object panel, Field section, under Caption : make it blank, under Appearance : none, under Presence : invisible, let the rest as it is. In the Value section, under Type : Read Only, under Default : Off. In the Binding section, under Name : name it CheckMarkOnOff, leave the rest as it is.
    5) So you have now four objects in the page 1. In the Hierarchy panel set each object by dragging them in
    this order :
    CheckBox
    CheckMarkModel
    ClickCheckBoxButton
    CheckMarkOnOff
    In the form select all the objects and group them. If you copy the group as many times you need you automatically will have an other Check Box, ready to work.
    So here you are with an personal Check Box.
    Don't forget to set the preview PDF to dynamic under Menu /File/Form Properties, the in the dialog box that shows up /Default tab and under the XDP Preview format : select in the list an Acrobat Dynamic form.
    REMEMBER that this will work only with forms saved as dynamic PDF.
    If somebody from Adobe could upload the sample file i made, to the forum, so that anybody can download it to his computer, would be appreciated, email me at : [email protected] .
    Regards Mike.

    I also faced this same problem and there is an actual solution but it involves modifying the xml source for the checkbox - however it is a simple modification so if your not familiar with editing the xml source don't worry about that. <br /><br />Click on the checkbox you want to modify and then click on the XML Source tab. LiveCycle will take you to that point in the XML. <br /><br />Now, scroll down until the close of the ui node( </ui> )within the checkbox field and modify the font node to look like the following:<br /><br /></ui>  -- close of UI node<br /><font typeface="Arial"><br />   <fill><br />      <color value="0,0,255"/><br />   </fill><br /></font><br /><br />This produces a checkbox with a blue check mark. <br />You can, of course, make the color any RGB number you want.<br /><br />You can then save that field in your library and reuse it anytime you want and it will always have that color checkmark. <br /><br />Good luck. <br />-Andrew

Maybe you are looking for

  • Travel Management

    Hi All, All the required configurations have been done and the trip request has been saved by the traveler. I am getting a error while sending / over viewing the trip request to the approving manager as " Error at the start of form processing " Messa

  • Mark Up Price in the Pricing Procedure

    Hi I want to add 45 % of my Moving avg price  automatically , when i select my pricing procedure.Say if the price is 100 $, i want to select the pricing condition and expecting the system to assign 145 % automatically.How to do in the Pricing Procedu

  • Is there any way to save a duplicate Word copy of something I save in Pages?

    I am saving a Pages file and was wondering; Can you save an exact copy, at the same time, while saving that Pages file? Or do I have to do that seperately? Just wondering!!

  • Please help!!!!  Favorites show only numbers and no names

    I have seen this question, but no solution.  All of the sudden, when i look at my contact favorites only numbers are displayed, with no names.  For example my wifes number is there but not her name.  Furthermore, in the contacts app, she is not there

  • How to get nodes from nlp

    Hello all! My mean problem is that I dont know how to extract nodes from GrammaticalStructure. I am using englishPCFG.ser in java netbeans. My target is o know the quality of the screen like: the screen of iphone 4 is great. I want to extract screen