www.webdeveloper.com
Results 1 to 4 of 4

Thread: Blogger: Problem with hiding widgets using checkboxes

  1. #1
    Join Date
    Sep 2013
    Posts
    2

    Question Blogger: Problem with hiding widgets using checkboxes

    Hello,
    I am trying to hide widgets from blogger using checkboxes.
    Relevant part of the code:
    <b:section-contents id='sidebar-left-1'>
    <b:widget id='HTML2' locked='false' title='' type='HTML'>
    <b:includable id='main'>
    <b:if cond='document.Testform.Art[0].checked == true'>
    <!-- only display title if it's non-empty -->
    <b:if cond='data:title != &quot;&quot;'>
    <h2 class='title'><data:title/></h2>
    </b:if>
    <div class='widget-content'>
    <data:content/>
    </div>

    <b:include name='quickedit'/>
    </b:if>
    </b:includable>
    </b:widget>
    Relevant part of the code somewhere else:
    <form name="Testform" action="">
    <input type="checkbox" name="Art" value="SHTML2" /> Show HTML 2
    <input type="checkbox" name="Art" value="SHTML1" /> Show HTML 1
    </form>
    The problem is: It does not work (even after reloading the site while the box remains checked)
    Compared with otheres here I am quite new to HTML etc and hope you can help me out on this and show me what I did wrong.
    Friendly greets,
    lviolal

  2. #2
    Join Date
    Sep 2013
    Posts
    221
    I have used the below code using checkbox and it works quite well. But the code is slight different from the one you posted. Hope you find your solution.

    require(["dijit/form/CheckBox", "dojo/domReady!"], function(CheckBox){
    var checkBox = new CheckBox({
    name: "checkBox",
    value: "agreed",
    checked: false,
    onChange: function(b){ alert('onChange called with parameter = ' + b + ', and widget value = ' + this.get('value') ); }
    }, "checkBox");
    });

    Design:

    <input id="checkBox" /> <label for="checkBox">I agree</label>

  3. #3
    Join Date
    Sep 2013
    Posts
    2
    Thank you for that answer.
    I am not familiar with this kind of code (knowing only a bit html and the stuff I used).
    Could someone tell me how and where to implement this code?
    That would be great

  4. #4
    Join Date
    Sep 2013
    Posts
    221
    Well implement this code in your css page.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles