Hiding Button if Conditions are met

I have a form that has 3 drop down boxes with options 1,2 and 3 in them.  I want to hide a button if "1" is selected for either of the 3 drop down boxes.  But the problem is I want it to re appear if the user changes their mind and wants to select 2 or 3.  So at no point and time do I want the button visible if "1" is selected.  But I do want it visible if  none of the boxes have "1"or are blank.
Thanks in advance for taking the time to help.

Hi uschad123,
Here's a way to do it:
Set the bound values as numbers: 1,2,3 in the Binding Tab of the Object Pallet
then using formCalc you put a script "like" this on the "exit" event on all 3 drop-down boxes:
////////////////////// formCalc:
if ($ le "1" | ddl2 le "1" | ddl3 le "1") then
     button1.presence = "hidden"
else
     button1.presence = "visible"
endif
you'll need to adjust the script slightly for each drop-down box. My example uses formCalc, but javaScript is just as easy.
////////////////// javascript:
if (this.rawValue <= "1" || ddl2.rawValue <= "1" || ddl3.rawValue <= "1")
      button1.presence = "hidden";
else
     button1.presence =  "visible";
also with this, you'll need to adjust the script slightly for each drop-down box.
Good luck,
Stephen

Similar Messages

  • Keep focus in a control until certain conditions are met?

    Hello,
    Is there a way to keep focus at a control until certain conditions are met?
    For example, if I might want to keep the focus set to a text field inside a tab unless the text field contains something valid.
    If user tries to switch to different tab without having valid text inside the text field, I would like to pop up a stage/dialog and abort the tab switching.
    Please help!
    Thanks.

    Hi. Here is an example:
    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.*;
    import javafx.scene.layout.*;
    import javafx.scene.paint.Color;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import javafx.stage.WindowEvent;
    public class SSNValidation extends Application {
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(final Stage primaryStage) {
            primaryStage.setTitle("SSN Validation");
            Button btn = new Button();
            final TextField tfSSN = new TextField();
            StackPane layout = new StackPane();
            Scene scenePopup = new Scene(layout, 424, 154, Color.TRANSPARENT);
            final Stage stage = new Stage();
            stage.initModality(Modality.APPLICATION_MODAL);
            stage.setScene(scenePopup);
            stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
                @Override
                public void handle(WindowEvent event) {
                    tfSSN.requestFocus();
            tfSSN.focusedProperty().addListener(new ChangeListener<Boolean>() {
                public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, final Boolean newValue) {
                    if (!newValue) {
                        if (tfSSN.getText().length() < 9) {
                            stage.show();
            final TextField tf2 = new TextField();
            btn.setText("Submit");
            VBox root = new VBox();
            root.getChildren().addAll(tfSSN, tf2, btn);
            primaryStage.setScene(new Scene(root, 300, 250));
            primaryStage.show();
    }

  • Hold indicator state if conditions are met for review at end of test

    I am looking to have an indicator stay true if conditions are met. I can get it to go on just not stay on. Example: if 5>0 and 10>0 then true (and stay true until reset. It is probably something really easy and I am just missing it but I am not sure what labview combination of items to make the value stay until reset.

    Paul and IanW,
    I thank you for your posts....I think I have the solution but not sure why it does not work in my application. Attached is Paul's version modified to look like my version but they do not act the same.....My VI was created in 6 and migrated to 7.1 with the upgrades. This is the only thing that I can think of. Does this mean I have to redo my VI in the new version to fix this issue or am I just missing something.
    Thanks,
    Kyle
    Attachments:
    keepBooOn.vi ‏143 KB
    Full Lab_verlatch.vi ‏170 KB

  • Quick question - making button visible if two conditions are met

    I simply want a button to be visible is once condition is true and another condition is false. Shouldn't this line of code work?
    <mx:Button id="Btn"label="
    Submit"color="
    #FF0000"enabled="
    {islRequired}" visible=" 
    {!.isAdmin}  {isRequired}"
    click="submit()" 
    />
    isadmin = false
    isrequired = true
    the button should be visible
    Am I missing something?

    Maybe you miss OR (||) or AND (&&), but I never use at mxml
    visible="{!.isAdmin && isRequired}" 
    Works?
    Best Regards,
    Miguel

  • RBATP - is it possible to activate them only if certain conditions are met?

    Hello APO - RBATP experts!
    I have a question that I hope you can help me with:
    Is it possible to have rules that become active only in certain circumstances, for example, if the RDD of the sales order is today or tomorrow?
    I have limited knowledge on the topic; so your help will be greatly appreciated.
    This is my scenario:
    A sales order is raised in plant A for Material X, if there isn't enought inventory of Mat. X, there will be a rule to look for inventory in plant B. If stock is found in plant B; then an ATP Tree structure is created, which is then turned into a purch req; and then into an STO from Plant B to Plant A. Then the shipment is sent to the customer from Plant A. This is good, however, this is not what we want for sales orders that are placed with too much time in advance; because by the time the sales order needs to be delivered, the inventory may be available in Plant A, and those requirements are meaningless at that point. Any ideas of how to handle this? Thanks in advance!

    Hi DB:
    Here are my answers:
    If the requirement is placed upon B, how is it possible to later have excess inventory in A? 
    If the sales order was placed let's say 7 weeks in advance; during that time the whse could have received inventory from the plant.
    This is mainly why I need to find a way for the rule to do the substitution and create the requirement in B, only if RDD is very close to today's date.
    Is there a reason why wouldn't ship directly from B to the customer? (instead of first moving the stock to A) 
    Yes there is, the requirement of the business is that any sales order raised in A, must be shipped from A; but stock must be found in alternate locations to satisfy the order. If stock is not found, then the order is cut and shipped.
    Is A a plant, depot, or both?
    Is B a plant, depot, or both?
    How is 'B' normally supplied? 
    Are you using MLATP?  CTP?
    Both are depots; and are supplied from different  manufacturing plants across the country.
    We are using MLATP.
    Thanks again for your input!

  • Restarting the executable until all conditions are true

    I wonder if I could be very clever and find the way out of my problem here.
    I am communicating with a device over UDP and for some reason, the device doesn't often establish communication with my Labview Executable on the first attempt.
    I run it, it fails, I then use CTRL+ALT+Delete to shut it down. I donubleclick the executable ICON on the desktop again and I sometimes do it five or six times then finally the communication is established and it all works.
    I wonder if I could add some code in the application to automate this process. One of the way I could now think to do is by creating another vi and call my current vi dynamically and add all those conditions into cluster, call this cluster (by wiring to the output terminal of the current main vi into new main vi) and monitor my cluster in the new main vi to see if the conditions are true if so continue or reload the current vi until those conditions are met? Is it the right way to do this? Or can I make my life easier and applcation more stable by doing something different?
    Kind Regards Austin

    Can you post your current code and show us the part that is communicating via UDP. I think the way to go is deffinately make your current code stable rather than an automation of failing code.
    Also what is the device you are trying to communicate with. Does this have a set protocol that you need to follow or is it one you are trying to figure out.
    Let us know and we could help you further.
    Matthew Trott
    Applications Engineer
    National Instruments UK
    www.ni.com/ask

  • Capturing data instantane​ously after condition is met using 2 DAQ cards

    Hi all,
    I am wanting to sample a pulse and a sine wave at a low frequency of 1 kHz point by point sampling and upon a condition being met - the leading edge of the pulse being greater than a certain value - I the want to take a certain number (here 270) of samples of the sine wave at 50 kHz, multiple samples. I am doing this within a case structure and using a separate DAQ card. 
    The problem is that when the conditon is met is does not capture the data at the higher frequency straight away. It misses part of the sine wave before commencing capturing the 'window' of the 270 samples of the sine wave at 50 kHz. I want to know if there is any way of speeding this up? I am aware that using an FPGA could help but I don't have access to one. 
    The other solution would to advance the condition, i.e advance the pulse train by a certain amount so that I compensate for the delay in activating the high freq capture. I would need to set up this advance of the pulse train so that, after the delay in activation, it captures the data exactly where it is required to. What would be the best way to do this? I could delay the pulse train by a certain number of samples/ or delay the sine wave, or I have read that you can use the sample timer/counter within the DAQ card to change the 'trigger of the pulse train'. How would I implement this?
    Attached is my vi. I would be very appreciative if you could help. 
    Attachments:
    2 DAQ cards Low and High Freq Sampling.vi ‏29 KB

    I do not have DAQmx or any suitable DAQ devices so I have not tested this.
    This is a start on cleaning and speeding things up. Note that writing to the front panel indicators at 1 kHz will not work because the screen update rate is on the order of 50-100 Hz. Also charts take a considerable amount of computation beacuse they need to (1) store data in the internal buffer, (2) erase old data if the buffer is full, and (3) (slowest) recalculate all the pixels in the display for the updated data. The cart should be moved to the parallel loop. The condition True boolean will only be true for about 5 ms out of each 100.  Look at the 5 ms boolean.vi  attached. It runs close to 1 ms per iteration. The boolean is true about 5% of the time but I never see it change. Remove that boolean from your VI.
    With continuous sampling on the pulse channel and reading 1 sample every millisecond (assuming you get that fast) when the high speed sampling occurs it takes 5.4 ms to acquire the 270 high speed samples. So, ten times per second the loop takes >= 6.4 ms for an iteration. The next sample it reads from the pulse channel is the one which was measured (acquired) at 1 ms after the previous sample. Thus, this data point is read ~5.4 ms after it actually occurred. The next time you detect a pulse, it will be 5.4 ms late. The second one will be 10.8 ms late. Eventually you will get a buffer overflow, but your data will be useless long before the error occurs.
    The Dual Sampler Simulator.vi shows a possible approach to the issue. It simulates sampling both channels at high speed.  I generate both a sine wave and a square wave and sample both at 50 kHz. It simulates reading 4000 samples at a time (equivalent to reading 12.5 times per second or every 80 ms). The square samples are then processed for the transition using the boolean Implies function. I do not recall whether the Conditional terminal was available in LV2012. I did not get an error when saving for previous version so I think it will be OK. The same thing can be done with a while loop with some extra logic.  This does not handle the case where the transition occurs at the boundaries of the 4000 sample segment. To handle those cases use a shift register on the outer loop to pass the needed samples to the next iteration. The 800 ms Wait makes it run slower than "real" time but allows you to see what is happening.
    Lynn
    Attachments:
    2 DAQ cards Low and High Freq Sampling.2.vi ‏26 KB
    5 ms boolean.vi ‏10 KB
    Dual sampler simulator.vi ‏15 KB

  • Jquery + json generate html buttons with condition

    Hi all,
    My need is to generate buttons with conditions described in json. Help me please, I’m newbie.
    Here is my json code (it is valid, but does not work with html code below) :
        "Caption": "Module caption",
        "IconsDirectory": "C://Images/",
        "Buttons": [
                "Conditions": [
                        "ConditionText": "1 == 1",
                        "ButtonText": "Text1",
                        "Visible": true,
                        "Colors": {
                            "FontColor": "#FFFFFF",
                            "BGColor": "#00FF00"
                        "Size": {
                            "Width": 200,
                            "Height": 50
                        "Icon": {
                            "FileName": "Smile.png",
                            "Width": 16,
                            "Height": 16
                        "Url": {
                            "UrlAddress": "http://www.google.com",
                            "OpenNewWindow": true
                        "JavaScriptAction": {
                            "Text": "alert('ok');"
                        "ConditionText": "2 == 2",
                        "ButtonText": "Text2",
                        "Visible": true,
                        "Colors": {
                            "FontColor": "#FFFFFF",
                            "BGColor": "#00FF00"
                        "Size": {
                            "Width": 200,
                            "Height": 50
                        "Icon": {
                            "FileName": "Smile.png",
                            "Width": 16,
                            "Height": 16
                        "Url": {
                            "UrlAddress": "http://www.google.com",
                            "OpenNewWindow": true
                        "JavaScriptAction": {
                            "Text": "alert('ok');"
    html code:
    <html>
    <head>
    <title>SMButtons</title>
    [removed][removed]
    [removed]        
    //When document loaded.
    $(document).ready(function(){  
    // Get data from file as JSON
                $.getJSON('weekendtask.json', function(data) {
            var buttons = data.Buttons;
               $.each(buttons, function(key, val)
                        $('<li><input type="button" value="'+ val.ButtonText +'"/></li>').appendTo('#ulObj');
       [removed]
    </head>
    <body>
    <br>
    <br>
    <div>
    <ul id='ulObj'>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    </ul>
    </div>
    </body>
    </html>
    Also I would like to show here my working code (generating html buttons from json without condition).
    json code (it works) :
        "Caption": "Module caption",
        "IconsDirectory": "C://Images/",
        "Buttons": [
                "TText": "google",
                "JavaScriptAction": "alert('google')"
                "TText": "microsoft",
                "JavaScriptAction": "alert('microsoft')"
                "TText": "yahoo",
                "JavaScriptAction": "alert('yahoo')"
    html code (it works) :
    <html>
    <head>
    <title>SMButtons</title>
    <script src="jquery/jquery-1.4.2.js"></script>
    <script type="text/javascript">                 
    //When document loaded.
    $(document).ready(function(){  
    // Get data from file as JSON
                $.getJSON('Module.json', function(data) {
                // Set json data from file to variable 'persons'
        var buttons = data.Buttons;
        var icondir = data.IconsDirectory;
        // For each item of variable person append to ul list
               $.each(buttons, function(key, val)
                        //$("<li><input type='button' onClick='"+ val.Url +"' value='"+ val.Text +"'/></li>").appendTo('#aaa');
    //$("<li><input type='button' style='"+ val.Style +"' onClick='"+ val.Url +"' value='"+ val.Text +"'/></li>").appendTo('#aaa');
    //$("<li><input type='button' value='"+ val.TText +"'/></li>").appendTo('#bbb');
                        //style="height: 25px; width: 100px"
                        //$('<li><input type="button" onClick="'+ val.action +'" value="'+ val.Text +'"/></li>').appendTo('#aaa');
                        $('<li><input type="button" onClick="'+ val.JavaScriptAction +'" value="'+ val.TText +'"/></li>').appendTo('#ulObj');
        //var knop = data.Knop;
        // For each item of variable person append to ul list
               //$.each(buttons, function(key, val)
                        //$("<li><input type='button' onClick='"+ val.Url +"' value='"+ val.Text +"'/></li>").appendTo('#aaa');
    //$("<li><input type='button' style='"+ val.Style +"' onClick='"+ val.Url +"' value='"+ val.Text +"'/></li>").appendTo('#bbb');
                        //style="height: 25px; width: 100px"
                        //$('<li><input type="button" onClick="'+ val.action +'" value="'+ val.Text +'"/></li>').appendTo('#aaa');
                        //$('<li><input type="button" onClick="'+ val.action +'" value="'+ val.Text +'"/></li>').appendTo('#aaa');
       </script>
    </head>
    <body>
    <br>
    <br>
    <div>
    <ul id='ulObj'>
    <li>1</li>
    </ul>
    </div>
    <br>
    <div>
    <ul id='aaa'>
    <!--<li>1</li>-->
    </ul>
    </div>
    <!--<button type="submit" style="height: 95px; width: 550px"> </button>-->
    <!--background: url('img/submit_button.jpg'); background-position: center; background-repeat: no-repeat;  background-color:Transparent;-->
    <div>
    <ul id='bbb'>
    <!--<li><img src="img/submit_button.jpg"/></li>-->
    <!--<li>Button caption</li>-->
    </ul>
    </div>
    </body>
    </html>

    What you are saying makes great sense. It's just the mechanics behind what you've said that I'm unclear about.
    <p>
    Are you saying to create another button within the same region with the same attributes/position, so they overlay each other? Then set the conditions on both buttons?
    <p>
    If I understand the above correctly, then how do I set the conditions? I guess I'm asking where do I place the SQL statement and how does the results relate to the button conditions?
    <p>
    Thanks for the help,
    David

  • Buttons hiding buttons on indesign

    Hi hope you can help. I'm using indesign CS5 and have a problem with pop up buttons being hidden by other buttons. The page design is a 7 column grid with around 10 buttons underneath each column that act as hyperlinks and trigger other show/hide buttons that give a brief summary of the info at the destination of the hyperlink. So in total there is about 140 buttons - 70 shown all the time and 70 pop ups. To help me manage the design I set up the pop up buttons in 7 separate layers as they overlay the buttons in the 7 column grid. When I export to PDF the pop up buttons appear but are partially hidden by the other buttons. Strangely this is only happening for a proportion with some appearing as they should and in the button tool bar review option they all appear fine. It also worked fine on initial exports and the problem only started when I rearranged the tab order.
    Any any help would be much appreciated!
    James

    Hello,
    I do not think that the BASIS can help you in deleting/hiding buttons from the UI. Generally, the buttons are stored in the GT_BUTTON/GT_BUTTONS attribute of the overview view/viewset controller. In some cases it may be hard coded inside the htm page as well in the form of HTML tags.
    We'd definitely need to do some programming to achieve the functionality you are looking for, Also remember it is different for different views. You need to find out the view that has the buttons.
    Do a F2 on your UI screen to find out the details of the screen.
    Regards
    Prasenjit

  • Hiding buttons based up on business role; Is possible by the BASIS?

    Hi Experts,
    I have done one enhancement for hiding the buttons according to Business role using coding but it was not possible for all the desired buttons since I couldnu2019t find out relevant internal tables for the buttons.
    Now we are planning to do the same activity by the BASIS help.
    Are Hiding buttons based up on user or business role can be possible by the BASIS activity like authorization object to handle the drop downs based up on roles .
    If possible please suggest me the way out to resolve the issue using any kind of BASIS activity.
    Thanks
    Chand

    Hello,
    I do not think that the BASIS can help you in deleting/hiding buttons from the UI. Generally, the buttons are stored in the GT_BUTTON/GT_BUTTONS attribute of the overview view/viewset controller. In some cases it may be hard coded inside the htm page as well in the form of HTML tags.
    We'd definitely need to do some programming to achieve the functionality you are looking for, Also remember it is different for different views. You need to find out the view that has the buttons.
    Do a F2 on your UI screen to find out the details of the screen.
    Regards
    Prasenjit

  • Simulate "When button pressed" condition

    I created a button a page (in region position).
    When I go to the Edit page for the button, the Optional URL Redirect section says "No target".
    I have a After Submit process on the page that has its "When button pressed" condition set to that button.
    Now, before firing the process, I would like to popup a Javascript confirm box that checks some value on the page and if it is ok, it submits the page
    So, I went to the URL redirect section on the button and changed the target to URL and specified the following URL
    javascript:{if (document.getElementById('SOME_ELEMENT').value=='foo' || confirm('Are you sure?')) doSubmit('BUTTON_NAME');}
    Now, what change do I need to make to the After Submit process to simulate the 'When Button Pressed' condition? Or would it automatically know that the submit was (indirectly, via the doSubmit) due to the button being pressed and accordingly fire?
    Hope I explained this clearly.
    Thanks

    Actually, I didnt need to change anything in my After Submit process. I still had it execute with no conditions and a 'When Button Pressed' of BUTTON_NAME and it worked fine! I didnt need to use the REQUEST value anywhere.
    Is this just a co-incidence, did I get lucky or is this the way things are supposed to work?
    javascript:{if (document.getElementById('SOME_ELEMENT').value=='foo' || confirm('Are you sure?')) doSubmit('BUTTON_NAME');}
    Or would it automatically know that the submit
    was (indirectly, via the doSubmit) due to the
    button being pressed and accordingly fire?The answer to my question above would seem to be "yes". Is that right?
    Thanks

  • I'm trying to write a formula to return a blank cell if the condition is met, and to show the numerical difference if not.  Here is what I've written:=IF((F35-F29)=0, " ", (F35-F29)). It is returning 0.00, not a blank cell.  Where is my error?

    I'm trying to write a formula to return a blank cell if the condition is met, and to show the numerical difference if not.  Here is what I've written:=IF((F35-F29)=0, " ", (F35-F29)). When the condition is met (i.e., the difference=0) it is returning 0.00, not a blank cell.  Where is my error?

    Without knowing what is in F35 and F29, I can only guess.  Your formula matches what you said but if F35 and/or F29 are the results of formulas and are decimal numbers (not integers), it is very possible that they are not exactly the same number even though you think they should be.  IEEE Floating Point math often has very very small errors so the answer is not exactly what you would get with a pencil and paper. Try one or both of these things:
    Format the IF cell as scientific. is that 0.0 exactly zero? I suspect it will be some very tiny number.
    Type the exact same number into F35 and F29 and see if your IF formula works as you expect.
    You might need to use ROUND on F35, F29 and/or in your IF formula to get rid of the tiny math errors.
    If you search the forum for floating point math or IEEE 754 you should find more than a few posts about Numbers and floating point math. Or you can read about IEEE 754 on Wikipedia.  It trips up a lot of people.
    Here is a common example.  B2 and C2 are from the formulas shown in B1 and C1. They should both be exactly zero, if done with paper and pencil.  Neither is exactly zero (though I have them formatted with 2 decimals so they appear to be 0.00), they are different from each other, and subtracting one from the other is also not exactly zero.

  • Price and Pricing conditions are not copied to PO for a line item !!

    Hi
    I have created a PO w.r.t a PR which has only one line item.
    Now, I add another line item to this existing PO, i get an error message that the Price and Pricing conditions are not copied.
    How do i rectify this error !!
    Where might be the link for this Price and Pricing conditions to get copied in to this PO ??
    MaruthiRam

    What kind of PR and in the PO same material you enter for new line or new material and do you have any funcitonal authorization assigned o your user id
    please reply

  • TS4425 when trying to access photo stream on Apple TV, I am getting the error message terms and conditions have changed, but when I go into iCloud on my Mac the new terms and conditions are not appearing - How can I manually agree to them ?

    When trying to access photo stream on Apple TV, I am getting the error message terms and conditions have changed, but when I go into iCloud on my Mac the new terms and conditions are not appearing - How can I manually agree to them ?

    Welcome to the Apple Community.
    The following article(s) may help you.
    Photo Stream ToU's

  • Conditions are not editable in sales order

    Dear Friends,
    Could you tell the reason - Conditions are neither editable nor you can insert a conditin in sales order line item as the insert icon is inactive.
    Thanks & regards
    Pinky

    Please find my underlined reply
    Could be either of the 3
    1. Item category would not be allowed for pricing - it is ok
    2. Check if the item is rejected or - not rejected
    3. Check if invoice is created - invoice not created, this is the time if i am going to create/change the sales order
      Hi,
    The only reason for this is because this order has subsequent documents. - No subsequent documents
    Goto VA03.
    Nothing allowed
    Complete pricing lines are gray. I have so many manyal conditions
    Thanks for the response

Maybe you are looking for

  • Is there a way to make an HTML or CSS Dreamweaver template (not a website template)?

    This might be confusing. I'm not looking for a way to create a website template but a layout/DocType template that has an HTML skeleton in place. The reason I'm asking is that I do a lot of email designs in Dreamweaver and I want to get a template in

  • Passing variable in a select statement

    Everything about this query works except I'm trying to capture the @companyid (which is a variable) into a column in my table via my select statement. My error is Invalid column name 'A113', etc.  However it is the A113 I'm trying to insert into the

  • Solaris 10 u3 upgrade to u4 not working

    Trying to update from a patched solaris 10 u3 to solaris 10 u4 and it keeps failing. its a mirrored boot with solaris 10 and solaris express installed. The error it gives is that either it can't find the OS to upgrade or its un-upgradeable. Any ideas

  • How to put "selection options without intervals" on screen painter?

    Hello all,        I need to put a field for pernr(personal number) on screen painter (module program) and user should be able to enter a list of pernr's to process. I know in report program I can do this by: SELECT-OPTIONS: s_lpernr FOR pa001-pernr N

  • Wireless Connection between two routers

    Ok. I own two houses seperated by a driveway going to both garages. I have cable internet access linked to a Netgear WNDR3300. That router is sending a signal to a wireless PC, 2 Laptops, and my Mini when needed. My signal in the 2nd house is REALLY