KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Hiding or showing a button on a Web page using
PRODUCT: 4D | VERSION: 6.7 | PLATFORM: Mac & Win
Published On: August 10, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

There are times when you may want to hide or display a button. For example, in an add record session you may want to hide the delete button on an input form.

You can hide or display the delete button on an HTML page with the use of the <!--4DHTMLVAR--> tag.

For example:


The HTML page (Add_Record.html)


<HTML>

    <BODY>

    <FORM ACTION="4DACTION/WEB_AcceptAddRecord" METHOD=POST>

     ...rest of html form goes here...


      <!--4DHTMLVAR Delete_Button-->


    </FORM>


  </BODY>

</HTML>

==========================================

The 4D Method (Show_Hide_Button)


If (condition)


 Delete_Button:="<INPUT TYPE=Submit name=Button1 Value=Delete>" `if the condition is true the button is shown


Else


  Delete_Button:="" `if the condition is false, the delete button is hidden

End if

SEND HTML FILE("Add_Record.html")