Changing visibilty of buttons on another button click

Changing visibilty of buttons on another button click

  

Hi,

   I was doing the booking assignment exercise. I had a doubt that how can we make a button visible only after clicking another button. Also in case of a container, only after clicking a button it the container should show. It is said in the assignment 5 part 2 of that assignment.

Can anyone please help???


Thanks

Hi Devu,

You may want to consider using an IF widget to decide whether to show the second button or not (and maybe another one for the other container you mention?)... you just need to make sure whatever condition you use on the IFs will only evaluate to true after you click the first button (and will evaluate to false before)

Hi Devu  Mani,

                     You can use the display:none Style, Please find the attached oml.


Thanks

Rajendra Singh

Hi Devo Mani,


The solution provided by @Rajendra is totally correct But be careful since it only applies a CSS style that hides the container, the form is sent to the client anyways. The best option is to create a variable, a Boolean for example, which you can use to manipulate the display of any widget accordingly to your needs.


Quick and easy example:

  1. Create a Boolean variable and call it "ShowContainer" and set it by default to false;
  2. Click on your container and go to the display property and change it to  ShowContainer -> If the ShowContainer variable is set to true it shows the container otherwise it hides the container;
  3. On your Button Click action, assign the value of ShowContainer  to true.


And that's it, as simple as that.

Hope it helped !


Best Regards,

Diogo Romero



Romero wrote: u are a hero!

Hi Devo Mani,


The solution provided by @Rajendra is totally correct But be careful since it only applies a CSS style that hides the container, the form is sent to the client anyways. The best option is to create a variable, a Boolean for example, which you can use to manipulate the display of any widget accordingly to your needs.


Quick and easy example:

  1. Create a Boolean variable and call it "ShowContainer" and set it by default to false;
  2. Click on your container and go to the display property and change it to  ShowContainer -> If the ShowContainer variable is set to true it shows the container otherwise it hides the container;
  3. On your Button Click action, assign the value of ShowContainer  to true.


And that's it, as simple as that.

Hope it helped !


Best Regards,

Diogo Romero