Announcement

Collapse
No announcement yet.

Button to turn block display on

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Button to turn block display on

    I would like to have a button that will allow me to turn the display of a block on.
    It seems that buttons can only be used to link another application.
    I tried a PHP button with sc_block_display(blockname, on); in the php code, but it opens a window with a single OK button, I want to stay in the same app but simply when the button is clicked, display a block that is hidden.

    Thank you in advance for any help.

  • #2
    Yes, at the end of the buttoncode you need to do a sc_redir to the same app to get rid of the ok button. Another option would be to add a checkbox to the form and apply an ajax event on it to show/hide the block.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Thanks Albert. The problem is that I hid the blocks in OnLoad.
      I thought about the checkbox. I can do that but it seems an odd user interface to me.
      I guess that I could create a global variable to check whether to hid the blocks in OnLoad.
      Wish I had more flexibility in the use of buttons. For example, I wish I could put a button in block like a field.

      Comment

      Working...
      X