I've got a table, with a cell you can click in every line.
When clicked, a popup containing a form shows up.
When submitting the form, I'd like to change the background color of the cell I've just clicked. However, the code below doesn't work, and I'd like to know what's wrong (the popup is included once in the ftl file):
Thanks !
/************* html *************/
Expand|Select|Wrap|Line Numbers
- <td onclick="openCall(${i.id}, '${i.askable.label}', '${telephone}', this.parentNode)">
- ...
- </td>
Expand|Select|Wrap|Line Numbers
- <div style="clear:both"></div>
- <div class="lightBox" style="display:none" id="popupCallBackground"></div>
- <div class="popupLightBox" style="display:none" id="popupCall">
- <div class="popupLightBoxTop">
- <div class="popupLightBoxTitle">
- Téléphone de l'entreprise <span id="askableLabel"></span>
- </div>
- </div>
- <div class="popupLightBoxContent">
- Téléphone : <span id="telephoneCall"></span><br/>
- <form id="callForm" action="">
- <input type="submit" value="oui"/> <input type="button" value="non" onclick="closeCall()"/>
- </form>
- </div>
- <div class="popupLightBoxBottom">
- </div>
- </div>
Expand|Select|Wrap|Line Numbers
- function openCall(id, askableLabel, telephone, tr){
- $('popupCallBackground').show();
- $('popupCall').show();
- new Draggable('popupCall', {zindex: 5});
- $('askableLabel').update(askableLabel);
- $('telephoneCall').update(telephone);
- $('callForm').action="javascript:callPassed("+id+", '"+tr+"')";
- }
- function closeCall(){
- $('popupCallBackground').hide();
- $('popupCall').hide();
- }
- function callPassed(id, tr){
- var fin=new Date().format();
- tr.cells[4].innerHTML="passé le :<br/>"+fin;
- tr.cells[4].style.background="teal";
- AdminService.updatePhoneCall(id, function(data){
- });
- }