Remove the De
$ (". Delete"). On ("click",function(){ varID = $ ( This). attr ("value"); varConfigtypename = $ ( This). Next (). Next ("Input")). Val (); Ymprompt.win ({width:330, Height:200, Icocls:‘‘, message:' <div class= ' message ' > Are you sure you want to remove the ' +configtypename+ ' configuration? </div> ', TitleBar:false, Winpos:C, btn:[[' OK ', ' OK '],[' Cancel ', ' no ']], handler:getbutton1}); functionGetButton1 (btn) {//get the value of the button //Delete Row if(BTN = = "OK"){ varPath = $ ("#path"). Val (); Window.location.href= path+ "/deletesystemconfig.action?id=" +ID; } } });
Page
<a href= "javascript:void (0)" class= "delete" value= "${s.id}" Typename= "${s.configtypename}" > Delete </a>
This is defined by class, because the ID we get is always changing, so we use the var id = $ (this). attr ("value") to get the value of the ID (you can also add a hidden field later to get the ID)
<DivAlign= "Left" > <ahref= "javascript:void (0);"><imgclass= "Add"ID= "Addbtn"src= "${pagecontext.request.contextpath}/imgs/u2.png"/></a> </Div> <S:formID= "form"> <TableAlign= "Center"width= "960"Height= "+"Border= "1px solid"ID= "Systemconfig"/> <TRAlign= "Center"bgcolor= "Gray"cellpadding= "0"> <th>Serial number</th> <th>Configuration type</th> <th>is enabled</th> <th>Operation</th> </TR> <S:iteratorvalue= "Systemconfigpagesupport.result"var= "S"Status= "status"> <TRAlign= "Center"> <TD><S:propertyvalue= "#status. Index+1"/></TD> <TD>${s.configtypename}</TD> <TD> <s:ifTest= "#s. Isstart = = 1">Enable</s:if> <S:else>Not enabled</S:else> </TD> <TD> <ahref= "javascript:void (0);"class= "Update"value= "${s.id}"TypeName= "${s.configtypename}"Isstart= "${s.isstart}">Modify</a> | <!--<a href= "javascript:void (0);" onclick= "deletesystemconfig ();" > Delete </a>| - <ahref= "javascript:void (0)"class= "Delete"value= "${s.id}"TypeName= "${s.configtypename}">Delete</a> <inputtype= "hidden"ID= "path"value= "${pagecontext.request.contextpath}"/> </TD> </TR> </S:iterator> </Table>
Delete (note, after deletion, top up, so the ID will always change, so we use class to define, because the ID is unique)