2 Replies - 523 Views - Last Post: 17 January 2016 - 11:40 PM Rate Topic: -----

#1 anadityagi1023   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 17-January 16

Checkbox in HTML and Python

Posted 17 January 2016 - 08:04 PM

I need to make the checkbox responsive (in .HTML file), i.e on select of checkbox the url of the page should get modified and page should get refreshed. Following is my code.
{% for val in p_val %}
    <h4>{{ p_val.get('g_name') }}</h4>
    {% for att in p_val.get('atbut') %}
        <div class="checkbox">
            <label>
                <input type="checkbox" name="check" value="attvalue">
                    {{ att.get('name') }}
            </label>
        </div>
    {% endfor %}
{% endfor %}



Is This A Good Question/Topic? 0
  • +

Replies To: Checkbox in HTML and Python

#2 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 12350
  • View blog
  • Posts: 20,984
  • Joined: 19-March 11

Re: Checkbox in HTML and Python

Posted 17 January 2016 - 08:29 PM

You're going to want to crack open a can of javascript here - Python alone isn't going to do it for you.
Was This Post Helpful? 0
  • +
  • -

#3 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 1064
  • View blog
  • Posts: 4,105
  • Joined: 13-June 14

Re: Checkbox in HTML and Python

Posted 17 January 2016 - 11:40 PM

To expand on what jon.kiparsky said, Python is being used just to generate the HTML that the client receives. Of course, selecting things on a page is done on the client and the only language you have access to in order to handle such events is Javascript.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1