Hi,
I had a radio button before and now we need to create a checkbox for
multiple record selection and delete the link to delete is in a
seperate page and goes like this:
<table width="100%" cellpadding="2" border="0" cellspacing="1">
<tr><td colspan="3" nowrap><strong>#ActionLabel# <cfif ShowDelete><a
class="actionLinks" href="javascript:confirm('Are you sure you want to
DELETE this #ActionLabel#')?deleteItem('#tableName#',getCheckedValue
(document.displaylist.thisitem)):void(0)">Delete</a><cfelse>Delete</
cfif></strong></td></tr>
This is the form for the delete link.
Now the input for the check box along with the script is in one page
that has this: it deletes one record even if u check multiple records
as the javascript supports radio button
<script>
function getCheckedValue(radioObj) {
if(!radioObj){
//alert('Select an item');
return 0;
}
var radioLength = radioObj.length;
if(radioLength == undefined)
if(radioObj.checked)
return radioObj.value;
else
{
alert('Select an item');
return true;
}
for(var i = 0; i < radioLength; i++) {
if(radioObj[i].checked) {
return radioObj[i].value;alert(radioLength)
}
}
alert('Select an item');
return 0;
}
deleteItem = function(tableName,id){
if(id == 0) {/*alert('Select the item to Delete'); */ return;}
var o = new jsClass()
o.setCallbackHandler(displayResponse);
o.setErrorHandler(errorHandler);
o.RemoveObject(tableName,id)
}
dropItem = function(id){
if(id == 0) {/*alert('Select the Assignment ID to Drop');*/ return;}
var o = new jsClass();
o.setCallbackHandler(displayResponse);
o.setErrorHandler(errorHandler);
o.DropFundAssignment(id)
}
displayResponse = function(response){
alert(response)
//alert('Successfully Removed the #ActionLabel#');
window.location.href='?page=router&module=#module#&pinID=#pinid#';
}
errorHandler = function(err){
alert("Unable to Perform the request " +err);
}
AmendETA = function(EID){
if(EID == 0) {return;}
var o = new jsClass();
o.setCallbackHandler(displayResponse);
o.setErrorHandler(errorHandler);
o.AmendETA(EID);
}
</script>
Below is the form on this page that has the form element:
<form name="displaylist">
<table width="100%" cellpadding="0" border="0" cellspacing="0">
<cfscript>
temp = cgi.QUERY_STRING;
s=listcontainsnocase(temp,'pager','&');
if(s!=0)
temp=ListDeleteAt(temp,s,'&');
s=listcontainsnocase(temp,'end','&');
if(s!=0)
temp=ListDeleteAt(temp,s,'&');
s=listcontainsnocase(temp,'module','&');
if(s!=0)
temp=ListDeleteAt(temp,s,'&');
</cfscript>
<!--- <cfset url.start = url.start+perPage>
<cfset url.end = url.end+perPage> --->
<tr><td colspan="10" align="left"><<<a href="#cgi.PATH_INFO#?
#temp#&pager=#pager-1#&module=#module#">Prev</a> | <a
href="#cgi.PATH_INFO#?#temp#&pager=#pager+1#&module=#module#">Next</
a>>></td></tr>
<tr><td><br></td></tr>
<cfset counter = 1>
<cfloop query="variables.ListData" startrow="#start#"
endrow="#end#">
<cfif variables.ListData.CID NEQ 0>
<tr>
<td width="1%">
<input type="Checkbox" <!---type="radio"---> name="thisitem"
value=<cfif tableName EQ 'Object_Resources'>"#cID#"<cfelse>"#oID#"</
cfif> >
</td>
Please help me to make this work!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---