0

I have a dynamic list and I want base on the list field if is "0" the use gets popup message and if it is greater than "0" to go to next page in div/or iframe so it stays in the same page just add something to the screen.

Here what I have so far, I'm using flask, and I am a new to this so I need very clear instaction.

jQuery(document).ready(function($) {
  $(".clickable-row").click(function() {
    window.location = "allocate2";
    $(this).target("window2");
  });

});
body {
  background-color: #EEE;
  font-family: Helvetica, Arial, sans-serif;
}

a {
  text-decoration: none;
  color: red;
}

a:hover {
  background-color: black;
  color: white;
}

tr:hover {
  cursor: pointer;
  background-color: red;
  color: white;
}

h1 {
  margin: 0;
}

#container {
  background-color: white;
  width: 860px;
  margin-left: auto;
  margin-right: auto;
}

#header {
  background-color: #66ccff;
  color: white;
  text-align: center;
}

#content {
  padding: 10px 10px 10px;
}

#nav {
  width: 200px;
  float: left;
}

#nav ul {
  list-style-type: none;
  padding: 0;
}

#nav.selected {
  font-weight: bold;
  color: #EEE;
}

#main {
  width: 600px;
  float: center;
}

#window2 {
  width: 40px;
  float: right;
}

#footer {
  clear: both;
  padding: 10px;
  background-color: #999999;
  color: weight;
  text-align: right;
}
<body>
  <div id="container">
    <div id="header">
      <h1></h1>
    </div>
    <div id="content">
      <div id="nav">
        <h3>Menu</h3>
        <ul id="mymenu">
          <li><a href="/">Home</a></li>
          <li><a>1</a></li>
          <li><a href="">2</a></li>
          <li><a href="">3</a></li>
        </ul>
      </div>
      <div id="main">
        <h1>IP Alocation</h1>
        <table style="width:45%" border="1">
          <tr>
            <th>No</th>
            <th>Subnet</th>
            <th>%</th>
            <th>Subnet left</th>
          </tr>
          {% for l in available_address_list %}
          <tr id="tablerow" class='clickable-row'>
            {% for item in l %}
            <td> {{ item }} </td>
            {% endfor %}
          </tr>
          {% endfor %}

        </table>
      </div>
      <iframe name="window2" src="" width="100%" height="100%" frameBorder="0"></iframe>
    </div>
    <div id="footer">
      Copyright &copy; 2018 Issa Daniel
    </div>
  </div>
</body>

Thanks and good day.

  • [how to load url into div tag](https://stackoverflow.com/questions/8335198/how-to-load-url-into-div-tag) – t.niese Jan 21 '18 at 09:52
  • Hi, this was closer to what i needed https://stackoverflow.com/questions/7177080/how-do-i-load-an-url-in-iframe-with-jquery – Issa Daniel Jan 22 '18 at 09:34

0 Answers0