PDA

View Full Version : hide button if page default address changed ?



alattal
02-26-2010, 10:55 PM
i have a page with address http://www.indigorose.com .. and i have a button that i want to hide if the default address of my page http://www.indigorose.com changed 'by click in another button or by click in external link in the page'
so, How to hide a button if page default address changed ?
example below:

mystica
02-27-2010, 01:34 AM
Put the following code into the On Loaded event in your Web-Object:



default = Web.GetURL("Web");
if default ~= "http://www.indigorose.com/" then
Button.SetVisible("Button1", false);
end


Modified example attached.

alattal
02-27-2010, 09:32 AM
good evening,
thank you mystica it works fine fo me ..
but how to re-show the button when re-back to the default address 'by click back button or by click a button that redirect to the default address '
example below:

alattal
02-27-2010, 10:41 AM
i add 'else' and it works fine ..

default = Web.GetURL("Web");
if default ~= "http://www.indigorose.com/" then
Button.SetVisible("Button1", false);
else
Button.SetVisible("Button1", true);
end

have a nice day ..
alattal