2013-04-24 3 views
1

사용자가 디스플레이 : 삭제 열 내의 삭제 버튼을 클릭하면 삭제 확인 상자를 표시하려고합니다. 표시 할 대화 상자가 있지만 일단 사용자가 조치를 삭제하려고한다고 확인하면 호출되지 않습니다. 행이 삭제되지 않고 페이지가 다시로드됩니다. 삭제 확인이 없으면 행이 성공적으로 삭제됩니다. 뭔가 확인을 잘못하고 있어요.Struts 1 jsp에서 디스플레이 태그를 사용하여 확인 삭제

jQuery를 :

$(".btnShowDeleteConfirmation").click(function (e) 
      { 
      ShowDialog(true); 
      e.preventDefault(); 
      }); 

      $("#btnClose, #btnNo").click(function (e) 
      { 
      HideDialog(); 
      e.preventDefault(); 
      }); 

      $("#btnYes").click(function (e) 
      { 

      }); 

자바 스크립트 :

function deleteEntry(rowId) 
    { 
    document.getElementById('rowId').value=rowId; 
    document.forms['myForm'].action='/myAction/deleteAction.action?method=deleteRow'; 
    document.forms['myForm'].submit;  
    } 

표시 태그 테이블 :

<form action="" method="POST" id="mainForm" name="MyFormBean"> 

<display:table requestURIcontext="true" requestURI="/unavailability/loadUnavailability.action?method=loadForm" uid="myList" name="requestScope.unavailList" class="simple" pagesize="10" defaultsort="2" sort="list" cellspacing="0" excludedParams="*">  

<display:column property="startDate" title="Start Date" width="18%" decorator="com.mhngs.util.DisplayTagDateWrapper" sortable="true" headerClass="sortable"/> 
<display:column property="endDate" title="End Date" width="18%" decorator="com.mhngs.util.DisplayTagDateWrapper" sortable="true" headerClass="sortable" /> 
<display:column property="reason" title="Comments" width="30%" sortable="true" headerClass="sortable" /> 

<display:column media="html" width="10%" class="btnShowDeleteConfirmation"> 
<a href="#">Delete</a> 
</display:column> 


</display:table> 
<input type="hidden" name="rowId" id="rowId" /> 
</form> 
어떤 도움이, 감사

내가 지금있는 것은 감사하겠습니다

HTML : 사용자가 삭제 버튼을 클릭하면 표시됩니다.

<div id="overlay" class="delete_overlay"></div> 

     <div id="dialog_delete" class="delete_overlay"> 
     <form method="post" action=""> 
      <table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0"> 
       <tr> 
        <td class="web_dialog_title">Delete Row Confirmation</td> 
        <td class="web_dialog_title align_right"><a href="#" id="btnClose">Close</a></td> 
       </tr> 
       <tr> 
        <td>&nbsp;</td> 
        <td>&nbsp;</td> 
       </tr> 
       <tr> 
        <td colspan="2" style="padding-left: 15px;"> 
         <label>You seleted a row to be deleted</label> 
        </td> 
       </tr> 
      <tr> 
      <td>&nbsp;</td> 
      <td>&nbsp;</td> 
      </tr> 
      <tr> 
      <td colspan="2" style="text-align: center;"> 
       <input id="btnYes" type="submit" value="Yes" onClick="javascript:deleteEntry('<c:out value="${myList.rowId}"/>')"/> 
       <input id="btnNo" type="button" value="No" /> 
      </td> 
      </tr> 
      </table> 
     </form> 
    </div> 

답변

0

html로 양식 이름을 지정하지 않았습니다. 양식 태그에 "myForm"이름을 어디에 언급 했습니까?

<form name="myForm" .. > 
관련 문제