Hello everyone,
I have a simple question but I got stuck. How can I get label text in my views.py?
For example, below code prints None instead of the text in label. I set label value by javascript($(“#label_is_edit”).text(is_index_sample_text);) Thanks in advance.
In .html file
<div class="form-check form-switch" style="padding-left: 20%; padding-top: 3%;">
<input class="form-check-input" style="transform: scale(1.5);" name="is_edit" id="is_edit" type="checkbox">
<label class="custom-control-label font-italic" id="label_is_edit" for="is_edit" style="padding-left: 5%;"></label>
</div>
In views.py
print(request.POST.get('label_is_edit'))