Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery not hiding the buttons upon ready
    primarykey
    data
    text
    <p>When I try to use the below code with jfiddle, I comment out the jinja and the buttons hide as expected, but in the browser, the input buttons don't hide</p> <pre><code>{% extends "layout.html" %} {% block body %} &lt;div&gt; {% if session.logged_in %} &lt;form action="{{ url_for('add_entry') }}" method=post class=add-entry&gt; &lt;dl&gt; &lt;dt&gt;Stock Ticker: &lt;dd&gt;&lt;input type=text size=30 name=stockname&gt; &lt;dt&gt;Date: &lt;dd&gt;&lt;input id="datePicker" type="date" name='start_date'&gt; &lt;dd&gt;&lt;input type=submit value=Add&gt; &lt;/dl&gt; &lt;/form&gt; {% endif %} &lt;/div&gt; &lt;div&gt; &lt;form action="{{ url_for('edit_entry') }}" method=post class=edit-entry&gt; &lt;table class="entries"&gt; &lt;tr&gt; &lt;th&gt;stock ticker&lt;/th&gt; &lt;th&gt;date bought&lt;/th&gt; &lt;th&gt; Edit&lt;/th&gt; &lt;/tr&gt; {% for entry in entries %} &lt;tr&gt; &lt;td&gt;&lt;h2&gt;{{ entry.stockname }}&lt;/h2&gt;&lt;/td&gt; &lt;td&gt;{{ entry.start_date|safe }}&lt;/td&gt; &lt;td&gt; &lt;input type="hidden" name="name" value="Edit"/&gt; &lt;input class="show" type="button" id="edit-button" value="Edit"/&gt; &lt;input class="hide" type="button" id="cancel-button" value="Cancel Changes"/&gt; &lt;input class="hide" type="submit" id="save-button" value="Save Changes"/&gt; &lt;/td&gt; &lt;/tr&gt; {% else %} &lt;em&gt;Unbelievable. No entries here so far&lt;/em&gt; {% endfor %} &lt;/table&gt; &lt;/form&gt; &lt;/div&gt; {% endblock %} &lt;script&gt; $(document).ready( function() { var now = new Date(); var day = ("0" + now.getDate()).slice(-2); var month = ("0" + (now.getMonth() + 1)).slice(-2); var today = now.getFullYear()+"-"+(month)+"-"+(day) ; $('#datePicker').val(today); $(".hide").hide(); }); &lt;/script&gt; </code></pre> <p>and layout.html consists of...</p> <pre><code>&lt;!doctype html&gt; &lt;title&gt;Flaskr&lt;/title&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt; &lt;link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}"&gt; &lt;div class=page&gt; &lt;h1&gt;Flaskr&lt;/h1&gt; &lt;div class=metanav&gt; {% if not session.logged_in %} &lt;a href="{{ url_for('login') }}"&gt;log in&lt;/a&gt; {% else %} &lt;a href="{{ url_for('logout') }}"&gt;log out&lt;/a&gt; {% endif %} &lt;/div&gt; {% for message in get_flashed_messages() %} &lt;div class=flash&gt;{{ message }}&lt;/div&gt; {% endfor %} {% block body %}{% endblock %} &lt;/div&gt; </code></pre> <p>Fiddle: <a href="http://jsfiddle.net/5ZNTf/" rel="nofollow">http://jsfiddle.net/5ZNTf/</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload