Jump to content

Disable/enable or Show/hide


navid_miraj

Recommended Posts

Hi every one!I am making a script. I want to have a function in javascript to disable or disapear part of script. For example. I have to make a script to send a notification if the camera detect a motion. I want a function like this. If the motion detection is disabled then I dont want to see the rest of a script, but when I enabled it then I want to see the other fields.can some one help me, pleaseregards and sorry that my english not perfect is.navid

Link to comment
Share on other sites

you will need to check the 'motion detection' condition you have setup and then use the .disabled property of the objects you want to disable. This property has 2 values true or false.

var myButton = document.getElementById('formButton1');myButton.disabled = true;

This makes the button a light gray and unclickable on the form.If you want to hide it altogether you can use the style property

myButton.style.display = 'none';

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...