Hi guys, what i want my code to do is to open a modal window everytime i click a link which is a name and that modal window should open with the details of that name but that is not happening!! Instead only one link which is the first link can open the modal window but with the wrong details, the details of the last name in the list. Other name links do not open the modal window, i do not know what i'm doing wrong! Here is the code below;
*I left out the CSS for the code* {{extend 'layout.html'}} ............... ................ ............... <script> $(document).ready(function(){ $('#guardian').click(function() { //$(this).click(function(){ var hiddenSection = $('#regDetails'); hiddenSection.fadeIn() // unhide section.hidden .css({ 'display':'block' }) // set to full screen .css({ width: $(window).width() + 'px', height: $(window ).height() + 'px' }) .css({ top:($(window).height() - hiddenSection.height ())/2 + 'px', left:($(window).width() - hiddenSection.width())/2 + 'px' }) // greyed out background .css({ 'background-color': 'rgba(0,0,0,0.6)' }) .appendTo('body'); // console.log($(window).width() + ' - ' + $(window).height()); $('img#close').click(function(){ $(hiddenSection). fadeOut(); }); //}); }); }); </script> <div id="letterhead"> {{for head in head:}} <div class="details"> <img width="220px" height="200px" src="{{=URL('download', args=head.school_logo)}}" style="border: solid white 2px; border-radius: 5px;"/><br /> </div> <div class="details" style="padding-left: 10px;"> <h1> {{=head.school_name}} </h1><br /> {{=head.Telephone}}<br /> {{=head.Fax}}<br/> {{=head.Email}}<br /> <h3> STUDENTS RESULTS MANAGEMENT SYSTEM (SRMS v1) </h3> </div> </div> {{pass}} <div id='container'> <h3> SELECT STUDENT AND OR GUARDIAN VIEW THEIR PROFILE </h3> <table> <tr> <th>STUDENT</th> <th>CLASS</th> <th>GUARDIAN</th> </tr> {{for student in student:}} <tr> <td>{{=A('view', _class="glyphicon glyphicon-user", _href=URL( 'student_profile', args=student.id))}} | {{=student.surname}} {{=student.name}}</td> <td>{{=student.class_name.class_name}}</td> <td><a href="#" class="glyphicon glyphicon-user" id="guardian"> View | {{=student.guardian.surname}}</a></td> {{pass}} </tr> </table> <div id="regDetails"> <article class="popup"> <a href="#"><img src="{{=URL('static', 'images/close.png')}}" style="width: 50px; position: absolute; top:0px;left:0px;" id="close"/></a> <div style="margin-left: 5px;"> <center> <legend style="color: white;"><b>GUARDIAN DETAILS</b></legend> FULL NAMES: {{=student.guardian.surname}} {{=student.guardian. name}}<br /> CONTACT DETAILS: {{=student.guardian.contact_number}}<br /> <hr /> <textarea rows="7" cols="40" id="message" placeholder="Notify Guardian Via Text Message" style="color: black; border: solid 1px white; border-radius: 5px;"></textarea><br /> <hr /> <button type="button" style="border: solid 1px white; border-radius: 5px;">Send</button><button type="button" id="clear" style="border: solid 1px white; border-radius: 5px;">Clear</button> </center> <script> jQuery('#clear').click(function(){ document.getElementById('message').value=''; }); </script> </div> </article> </div> </div> <br /> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.