I`m having a problem with making my control invisible, if it is a standard<button>(not input button) or a div..it doesn`t mather..
Here is a pease of my code
var vElement = 'btnCalculate';
toggleVisibility(vElement);
vElement = 'dvCalc1';
toggleVisibility(vElement);
vElement = 'dvCalc2';
toggleVisibility(vElement);
// here is the javascript that i call from a pease of jquery
function toggleVisibility(controlId) {
var control = document.getElementById(controlId);
if (control.style.visibility == "visible" || control.style.visibility == "")
control.style.visibility = "hidden";
else
control.style.visibility = "visible";
Hope somebody knows the answer to this anoing issue..(it following me the complete weekend...)
I`m having a problem with making my control invisible, if it is a standard<button>(not input button) or a div..it doesn`t mather..
Hi,
When you need to invisible your control on page load or on a click of any control/div you have placed on your form. and Could you please post your complete code so that it would be much easier to provide you solution on your problem.
When button1 is clicked a jquery pop-up dialog apears when the dialog window is closed i need to hide button1 and show button2 (else the user wil get a pop-up everytime he/she click`s the calculate button)
Clubict
Member
222 Points
195 Posts
Ho to make a standard button visible false in jquery
Dec 05, 2011 07:00 AM|LINK
Hi All,
I`m having a problem with making my control invisible, if it is a standard<button>(not input button) or a div..it doesn`t mather..
Here is a pease of my code
var vElement = 'btnCalculate'; toggleVisibility(vElement); vElement = 'dvCalc1'; toggleVisibility(vElement); vElement = 'dvCalc2'; toggleVisibility(vElement); // here is the javascript that i call from a pease of jquery function toggleVisibility(controlId) { var control = document.getElementById(controlId); if (control.style.visibility == "visible" || control.style.visibility == "") control.style.visibility = "hidden"; else control.style.visibility = "visible";Hope somebody knows the answer to this anoing issue..(it following me the complete weekend...)
Best regards,
Mark
Huske
Contributor
4060 Points
756 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 07:06 AM|LINK
This is not jQuery that you are usng. It is just an ordinary JavaScript. In jQuery you code would look like this:
$('btnCalculate').toggle();Once you hide the button, you can redisplay it again using the same method.
mayankpathak...
Contributor
3643 Points
844 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 07:08 AM|LINK
Hi,
When you need to invisible your control on page load or on a click of any control/div you have placed on your form. and Could you please post your complete code so that it would be much easier to provide you solution on your problem.
Clubict
Member
222 Points
195 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 07:09 AM|LINK
I`m just calling javascript from a jquery statement..
But i qill try your suggestion..
Thanks!
Clubict
Member
222 Points
195 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 07:43 AM|LINK
Hi Huske,
I tried the following, and it didn`t work...what dit i do wrong?
Clubict
Member
222 Points
195 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 07:51 AM|LINK
Hi mayankpathak,
There is no need to post the complete code for this issue..
It is like this
<button id="button1">button1</button>
<button id="button2" style="visibility: hidden">button2</button>
When button1 is clicked a jquery pop-up dialog apears when the dialog window is closed i need to hide button1 and show button2 (else the user wil get a pop-up everytime he/she click`s the calculate button)
Hope this is enough info for you?
Best regards,
Mark
mayankpathak...
Contributor
3643 Points
844 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 07:52 AM|LINK
$(document).ready(function () { $('#btnCalculate').toogle(); });Clubict
Member
222 Points
195 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 07:59 AM|LINK
Hi,
Thanks!! this is the first time the control is invisible...the only problem is that it is already invisible when the page_load is completed..
So i have no button to click
i need the following:
button1.click = button1.hide and button2.show..
Best regards,
Mark
mayankpathak...
Contributor
3643 Points
844 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 08:09 AM|LINK
Hey mark
i didn't get you properly. If your button is already invisible when the page gets load then in which case you want it visible.
and what is button 2 in your scenario . Please explain it
Clubict
Member
222 Points
195 Posts
Re: Ho to make a standard button visible false in jquery
Dec 05, 2011 08:10 AM|LINK
hi,
i`ve some additional info,
When i press the ok button in the pop-up a postback is fired(C# code behind)
so could it be when i place this
$('#btnCalculate').toggle();
}
the control will disappear first but when the postback is completed the control wil be visible again?