Announcement

Collapse
No announcement yet.

User HTML checkbox

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

  • nonkelmike
    replied
    indeed, it should ve been STYLE!

    Leave a comment:


  • vatologic
    replied
    Originally posted by nonkelmike View Post
    HTML Code:
    IF (condition_of_if){
    echo '<script>#id_of_the_checkbox{display: none;}</script>';
    }
    You've mixed up CSS and JS here.

    CSS
    Code:
    <style>
    /* CSS */
    input[type=checkbox] .class-of-checkbox {
    display: none;
    } /* OR */ #id-of-the-checkbox {
    display: none;
    } </style>
    JS/jQuery
    Code:
    <script>
    // assuming jQuery is enabled
    if ( $( '#id-of-the-checkbox' ).length !== undefined && $( '#id-of-the-checkbox' ).length !== 0) { // check if the checkbox exists with the length method
    if ( *** SOME CONDITION HERE *** ) {
    $( '#id-of-the-checkbox' ).hide(); // to hide $( '#id-of-the-checkbox' ).show(); // to show $( '#id-of-the-checkbox' ).toggle(); // to toggle between hide and show
    }
    } </script>

    Leave a comment:


  • nonkelmike
    replied
    HTML Code:
    IF (condition_of_if){
       echo '<script>#id_of_the_checkbox{display: none;}</script>';
    }

    Leave a comment:


  • GlennDT
    replied
    Hi,

    any example on how to achieve it? It needs to be possible to modify the visibility at runtime.
    I'd like to hide the checkbox if a certain condition is met.

    thanks, regards
    Glenn

    Leave a comment:


  • nonkelmike
    replied
    with CSS display: none?

    Leave a comment:


  • GlennDT
    started a topic User HTML checkbox

    User HTML checkbox

    Hi, I have a control with User HTML (as an external library), in which I defined a checkbox.
    This checkbox appears correct, I can add an Ajax Onclick-event, so I can use this checkbox to set an option in the application.

    Now I would like to have the ability to hide the checkbox, sc_field_display does not seem to work correctly, so I wondered whether anyone has an idea to hide such a checkbox?

    thanks, regards,
    Glenn
Working...
X