Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="form-group">
- <label>Наименование задачи:</label>
- <select name="value" class="form-control" id="sel1" onclick="showOptions();">
- <option value="0">---Выберите задачу---</option>
- {% if tasks %}
- {% for task in tasks %}
- <option value="{{ task.id }}">{{ forloop.counter }}. {{ task.Title }}</option>
- {% endfor %}
- {% endif %}
- </select>
- </div>
- <div class="form-group">
- {% for opt in options %}
- <div class="option hidden" id="{{ opt.id }}">
- <label>Значение параметра "{{ opt.Title }}":</label>
- <textarea name="opt{{ opt.id }}" id="opt{{ opt.id }}" class="textarea"></textarea>
- </div>
- {% endfor %}
- </div>
- <script type="text/javascript">
- function showOptions(){
- $('.option').each(function(){
- $(this).addClass("hidden");
- });
- $('.option').each(function(){
- if $("#sel1").val() == {{ {{ options.$(this).id }}.Task }}
- $(this).removeClass("hidden");
- });
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement