I have been searching all over for a way to only translate the contents of a text box.... but I can only find ways to translate the entire website.
Below is a sample of the page code of the form we'll be submitting. I would like to just translate the contents of textarea name="emergency_procedures".
<form action="#cgi.script_name#?submit=<cfif url.id neq "">UPDATE&id=#url.id#<cfelse>YES</cfif>" method="post">
<table id="keywordEditTable" class="editTable" cellpadding="0" cellspacing="0">
<tr>
<td class="editLabel"><span>*</span>Type Title:</td>
<td class="editField">
<input type="text" name="name"<cfif url.id neq "">value="#trim(item.name)#"</cfif> size="35" />
</td>
</tr>
<tr>
<td class="editLabel"><span>*</span>Active:</td>
<td class="editField">
<input type="radio" name="active"<cfif url.id eq "" or item.active eq 1> checked="checked"</cfif> value="1" />
<label for="active">Yes</label>
<input type="radio" name="active"<cfif url.id neq "" and item.active neq 1> checked="checked"</cfif> value="0" />
<label for="active">No</label>
</td>
</tr>
<tr>
<td class="editLabel"><span>*</span>Default:</td>
<td class="editField">
<input type="radio" name="is_default"<cfif url.id eq "" or item.is_default eq 1> checked="checked"</cfif> value="1" />
<label for="active">Yes</label>
<input type="radio" name="is_default"<cfif url.id neq "" and item.is_default neq 1> checked="checked"</cfif> value="0" />
<label for="active">No</label>
</td>
</tr>
<tr id="editLastRow">
<td class="editLabel">Emergency Procedures:</td>
<td class="editField"><textarea name="emergency_procedures" cols="67" rows="15"><cfif url.id neq "">#item.emergency_procedures#</cfif></textarea></td>
</tr>
<cfif url.id neq "">
<tr id="editLastRow">
<td class="editLabel"></td>
<td class="editField">
</td>
</tr>
</cfif>
<tr>
<td class="editLabel"><span>*</span>Notify URL:</td>
<td class="editField">
<input type="text" name="notify_url"<cfif url.id neq "">value="#item.notify_url#"</cfif> size="65" />
</td>
</tr>
<tr>
</tr>
<tr>
<td></td>
<td id="editButtons">
<input type="submit" name="Make" value="<cfif url.id neq "">Update<cfelse>Create</cfif>" id="editButton" />
<cfif url.id neq "">
<input type="button" name="Delete" value="Delete" id="deleteButton" onclick="confirmDelete()" />
<input type="hidden" name="id" value="#url.id#" />
</cfif>
<input type="button" name="Cancel" value="Cancel" id="cancelButton" onclick="document.location='EMB_types.cfm'" />
</td>
</tr>
</table>
</cfoutput>
This is too long for a comment, but here goes. You want to use Google's REST API and / http. I haven't programmed out all the details but this should get you started
<cfscript>
endpoint = "https://translation.googleapis.com/language/translate/v2";
if (cgi.request_method == "POST") {
httpService = new http();
httpService.setMethod("post");
httpService.setCharset("utf-8");
httpService.setUrl(endpoint);
httpService.addParam(type="formfield", name="q", value= form.emergency_procedures);
httpService.addParam(type="formfield",name="target",value="yourlanguage");
httpService.addParam(type="formfield",name="key",value="yourkey");
result = httpService.send().getPrefix();
writedump(result);
}
</cfscript>
You are probably going to have tinker with the fields to get to work right. Currently the REST API documentation is at: https://cloud.google.com/translate/docs/reference/rest/v2/translate
I'm trying to capture geolocation data and insert it into a database.
The code below is my attempt to capture the browser's longitude and latitude and save the values in two form fields. The problem is the output code generates multiple instances of the two form fields (i.e. "longitude" and "longitude"). Here's a screen shot of a single set of those fields being populated. How do I populate the rest?
Form Code:
<div class="table-responsive">
<table class="table table-1" style="color:##000000">
<tr>
<td>Tree No</td>
<td>Current Status</td>
<td>Graft Successful</td>
<td>NOT Grafted</td>
<td>Graft unsuccessful</td>
<td>Tree Died</td>
</tr>
<cfoutput query="rsTreeList" >
<tr>
<td>#TreeID#</td>
<td>#Status#</td>
<td>
<form name="form1" method="post" action="Recon_Update_Logic1.cfm?ID=#TreeID#">
<img src="images/Icons/Success.jpg" width="25" height="25" alt=""/>
<input id="latitude" name="latitude" type="text" />
<input id="longitude" name="longitude" type="hidden" />
<input name="submit" type="submit" id="Submit" value="Graft Successful">
</form>
</td>
<td>
<form name="form1" method="post" action="Recon_Update_Logic2.cfm?ID=#TreeID#">
<img src="images/Icons/NotGrafted.jpg" width="25" height="25" alt=""/>
<input id="latitude" name="latitude" type="text" />
<input id="longitude" name="longitude" type="hidden" />
<input name="submit" type="submit" id="Submit" value="NOT Grafted">
</form>
</td>
<td>
<form name="form1" method="post" action="Recon_Update_Logic3.cfm?ID=#TreeID#">
<img src="images/Icons/GraftUnsuccessful.jpg" width="25" height="25" alt=""/>
<input id="latitude" name="latitude" type="hidden" />
<input id="longitude" name="longitude" type="hidden" />
<input name="submit" type="submit" id="Submit" value="Graft Unsuccessful">
</form>
</td>
<td>
<form name="form1" method="post" action="Recon_Update_Logic4.cfm?ID=#TreeID#">
<img src="images/Icons/TreeDead.jpg" width="25" height="25" alt=""/>
<input id="latitude" name="latitude" type="hidden" />
<input id="longitude" name="longitude" type="hidden" />
<input name="submit" type="submit" id="Submit" value="Tree Dead">
</form>
</td>
</tr>
</cfoutput>
</table>
</div>
The following code attempts to populate all of the "latitude" and "longitude" elements:
<cfloop index="i" from="1" to="#rsTreeList.recordCount#">
<script>
function getLocation()
{
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(showPosition);
}
}
function showPosition(position)
{
document.getElementById("latitude").value = position.coords.latitude;
document.getElementByID("longitude").value = position.coords.longitude;
}
getLocation();
</script>
</cfloop>
I have a page with this basic process:
Click checkboxes next to forms you want to download
Click submit
CFWindow pops up to collect some basic info
Click submit to download forms while staying in the window that was opened by CFWindow
When you click the submit button inside the CFWindow , it brings you back to the parent page. I want the form submission to stay inside the CFWindow. I saw this post: Refresh cfwindow content. However, the refreshOnShow = "true" does not work. Every time I hit submit, it goes back to the parent window.
Here is the Parent page:
<cfform name="myform">
<cfinput type="hidden" name="OrgID" value="#getit.orgID#">
<table width="95%" border="0" cellspacing="5" cellpadding="0" align="center">
<tr>
<td width="50%" valign="top" class="coretextforBR">
<cfinput type="checkbox" name="GetThese" value="#form_ID#">
<a class="corelinkforBR">#Forms_Name#</a>
<br /><br />
#Forms_Description#
<br /><br />
</td>
</tr>
<tr>
<td width="50%" valign="top" class="coretextforBR">
<cfinput type="checkbox" name="GetThese" value="#form_ID#">
<a class="corelinkforBR">#Forms_Name#</a>
<br /><br />
#Forms_Description#
<br /><br />
</td>
</tr>
<tr>
<td width="50%" valign="top" class="coretextforBR">
<cfinput type="checkbox" name="GetThese" value="#form_ID#">
<a class="corelinkforBR">#Forms_Name#</a>
<br /><br />
#Forms_Description#
<br /><br />
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit"value="Get It" onclick="javascript:ColdFusion.Window.show('mywindow1')">
</td>
</tr>
</table>
</cfform>
<cfwindow x="250" y="250" width="400" height="400"
name="mywindow1" title="Almost ready to download" initshow="false" draggable="false" resizable="false"
refreshOnShow="true" source="submitform.cfm?GetThese={myform:GetThese.value}&OrgID={myform:OrgID}&action=information"
bodystyle="background-color: white;" headerStyle="background-color: ###getcss.color#; font-family: #getcss.font#; color: ###getcss.fontcolor#;" />
Here is the source (submit.cfm) for the CFWwindow:
<cfparam name="attributes.action" default="information">
<cfoutput>
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
This window will collect information to begin download
<br>
<!--- action for downloading --->
<cfif attributes.action eq "download">
<cfloop info and stuff left out>
#Forms_Name#<br />
</cfloop>
<!--- what you see when page initially loads --->
<cfelse>
<form action="submitform.cfm?action=download" method="post">
<input type="hidden" name="GetThese" value="#attributes.GetThese#">
<input type="hidden" name="OrgID" value="#attributes.OrgID#">
<table width="95%" border="0" align="center">
<tr>
<td class="coretextforBR">First:</td>
<td><input type="text" name="CollectedInfo_First"></td>
</tr>
<tr>
<td class="coretextforBR">Last:</td>
<td><input type="text" name="CollectedInfo_Last"></td>
</tr>
<tr>
<td class="coretextforBR">Phone:</td>
<td><input type="text" name="CollectedInfo_Phone"></td>
</tr>
<tr>
<td class="coretextforBR">Email:</td>
<td><input type="text" name="CollectedInfo_Email"></td>
</tr>
<tr>
<td class="coretextforBR">Best way <br> to contact:</td>
<td><input type="text" name="CollectedInfo_BestWay"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Download" class="button one"></td>
</tr>
</table>
</form>
</cfif>
</cfoutput>
</body>
</html>
I have no idea what I am doing wrong. I couldn't find a definite answer to my problem either other than the refreshOnShow. Should I rethink and do a ajax submit?
Using <cfform> instead of normal <form> worked as Liegh suggested.
I would like to add additional functionality to a web site including the ability for a form to only be submitted once, this is so that when the user refreshes everything is not processed again etc.
I have looked at a few pieces of code using Jquery and javascript but was wondering if there was any way to do this in Coldfusion, and how do other people who use Coldfusion do it? I am looking for the most simple yet effective solution if possible.
Below is an example of a form that I would like to disable "resubmit" funtionality:
<cfinclude template="header.cfm">
<cfparam name="form.step" default="1">
<cfparam name="form.submit" default="">
<cfparam name="form.finish" default="">
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
var currentItem = 1;
$('#addnew').click(function(){
currentItem++;
$('#items').val(currentItem);
var strToAdd = '<tr><td class="Copy" valign="top">Item Name:</td><td><input type="text" name="Itemname'+currentItem+'" id="Itemname'+currentItem+'" required="yes" message="Please enter a Name" class="TextBlock"></td></tr><tr><td class="Copy" valign="top">Item Description:</td><td><input type="text" name="ItemDesc'+currentItem+'" id="ItemDesc'+currentItem+'" required="yes" message="Please enter a Description" class="TextBlock"></td></tr><tr><td class="Copy" valign="top">Quantity</td><td><input type="text" name="Quantity'+currentItem+'" id="Quantity'+currentItem+'" required="yes" message="Please enter a Quantity" class="TextBlock"></td></tr><tr><td class="Copy" valign="top">Product Code:</td><td><input type="text" name="Code'+currentItem+'" id="Code'+currentItem+'" required="yes" message="Please enter a Code" class="TextBlock"></td></tr><tr><td class="Copy" valign="top">Price:</td><td><input type="text" name="Price'+currentItem+'" id="Price'+currentItem+'" required="yes" message="Please enter a Price" class="TextBlock"></td></tr>';
$('#data').append(strToAdd);
});
});
//]]>
</script>
<cfif form.finish eq "finish">
<cflocation addtoken="no" url="inv_new.cfm">
</cfif>
<form id="formID" method="post" action="inv_new.cfm" enctype="multipart/form-data">
<table border="0" cellpadding="0" cellspacing="1" width="100%" class="Border" align="center">
<tr>
<td class="CopyWhite" align="left" background="images/tab_bg.gif" colspan="2">Add a new invoice</td>
</tr>
<cfoutput>
<cfif form.step eq 1>
<cfquery name="get_vendors" datasource="#application.db#">
SELECT * FROM tblpassVendor
WHERE vendorActive = 1
AND CompanyID = #session.companyid#
AND VendorID IN (#GetAdmin.AdminVendors#)
</cfquery>
<tr>
<td class="Copy" valign="top">Invoice Using:</td>
<td>
<Select name="INVBY">
<cfloop query="get_vendors">
<option value="#vendorid#">#vendorname#</option>
</cfloop>
</Select>
</td>
</tr>
<tr>
<td class="Copy" align="center" colspan="2">
<input type="Submit" name="Submit" value="Submit" class="submitbutton">
<input type="hidden" name="step" value="2" />
<input type="Reset" name="Reset" value="Reset" class="submitbutton">
</td>
</tr>
</cfif>
<cfif form.step eq 2>
<input type="hidden" name="vendor" value="#FORM.INVBY#" />
<tr>
<td class="Copy" valign="top">Order Details:</td>
<td>
</td>
</tr>
<tr>
<td class="Copy" valign="top">Payment Due:</td>
<td>
<input type="text" id="date1" class="validate[required]" name="INVPAYMENTDATE" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Reference Number:</td>
<td>
<input type="text" class="validate[required]" name="REFNUM" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Invoice Details:</td>
<td>
</td>
</tr>
<tr>
<td class="Copy" valign="top">Pay Using Masterpass:</td>
<td style="color:##000">
<input type="radio" name="MASTERPASS" value="1" checked="yes"> Yes<br />
<input type="radio" name="MASTERPASS" value="0" checked="no"> No<br />
</td>
</tr>
<tr>
<td class="Copy" valign="top">Pay Using Iveri:</td>
<td style="color:##000">
<input type="radio" name="IVERI" value="1" checked="yes"> Yes<br />
<input type="radio" name="IVERI" value="0" checked="no"> No<br />
</td>
</tr>
<tr>
<td class="Copy" valign="top">Pay Using Other:</td>
<td style="color:##000">
<input type="radio" name="OTHER" value="1" checked="yes"> Yes<br />
<input type="radio" name="OTHER" value="0" checked="no"> No<br />
</td>
</tr>
<tr>
<td class="Copy" valign="top">Billing Details:</td>
<td>
</td>
</tr>
<tr>
<td class="Copy" valign="top">Name:</td>
<td>
<input type="text" class="validate[required]" name="NAME" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Surname:</td>
<td>
<input type="text" class="validate[required]" name="LNAME" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Tel:</td>
<td>
<input type="text" class="validate[required]" name="TEL" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Email:</td>
<td>
<input type="text" class="validate[required,custom[email]]" name="EMAIL" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Address line 1:</td>
<td>
<input type="text" class="validate[required]" name="ADDR1" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Address line 2:</td>
<td>
<input type="text" class="validate[required]" name="ADDR2" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">City/Town:</td>
<td>
<input type="text" class="validate[required]" name="CITY" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Province/Region:</td>
<td>
<input type="text" class="validate[required]" name="REGION" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Country:</td>
<td>
<input type="text" class="validate[required]" name="COUNTRY" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">ZIP/Postal Code:</td>
<td>
<input type="text" class="validate[required]" name="ZIP" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" align="center" colspan="2">
<input type="Submit" name="Submit" value="Submit" class="submitbutton">
<input type="hidden" name="step" value="3" />
<input type="Reset" name="Reset" value="Reset" class="submitbutton">
</td>
</tr>
</cfif>
<cfif form.step eq 3>
<cftry>
<cfset payuid = "#CreateUUID()#">
<cfset invuid = "#CreateUUID()#">
<!---WRITE DATA TO TBLINV--->
<cfquery name="write_inv" datasource="#application.db#" result="test">
INSERT INTO tblpassInv
(INVVENDORID,INVREF,INVNAME,INVLNAME,INVTEL,INVEMAIL,INVADDR1,INVADDR2,INVCITY,INVREGION,INVCOUNTRY,INVZIP,INVCOMPANY,INVCREATEDBY,INVDATECREATED,INVACTIVE,INVSEND,paymentuid,invuid,invmasterpass,inviveri,invother,invpaymentdate)
VALUES
(#form.vendor#,'#form.REFNUM#','#form.NAME#','#form.LNAME#','#form.TEL#','#form.EMAIL#','#form.ADDR1#','#form.ADDR2#','#form.CITY#','#form.REGION#','#form.COUNTRY#','#form.ZIP#',#session.companyid#,#session.adminid#,#createodbcdatetime(now())#,1,0,'#payuid#','#invuid#',#form.MASTERPASS#,#form.IVERI#,#form.OTHER#,'#FORM.INVPAYMENTDATE#')
</cfquery>
<cfset NewPrimaryKey = test.GENERATED_KEY>
<!---<cfinclude template="inv_amend_prods_new.cfm">--->
<tr>
<td>
<table id="data">
<tr>
<td class="Copy" valign="top">Products/Line Items:</td>
<td>
</td>
</tr>
<tr>
<td class="Copy" valign="top">Item Name:</td>
<td>
<input type="text" class="validate[required]" name="Itemname1" id="Itemname1" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Item Description:</td>
<td>
<input type="text" class="validate[required]" name="ItemDesc1" id="ItemDesc1" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Quantity</td>
<td>
<input type="text" class="validate[required,custom[number]]" name="Quantity1" id="Quantity1" class="TextBlock">
</td>
</tr>
<tr>
<td class="Copy" valign="top">Product Code:</td>
<td><input type="text" class="validate[required]" name="Code1" id="Code1" class="TextBlock"></td>
</tr>
<tr>
<td class="Copy" valign="top">Price: (eg. 100.00)</td>
<td><input type="text" class="validate[required,custom[number]]" name="Price1" id="Price1" class="TextBlock"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<input type="Submit" name="Submit" value="Submit" class="submitbutton">
<input type="button" id="addnew" name="addnew" value="Add new item" />
<input type="hidden" id="items" name="items" value="1" />
<input type="hidden" name="step" value="4" />
<input type="hidden" name="invid" value="#NewPrimaryKey#" />
</td>
</tr>
<cfcatch type="any">
<script type="text/javascript">
alert("An error has occured! Please try again later")
</script>
</cfcatch>
</cftry>
</cfif>
<cfif form.step eq 4>
<cftry>
<cfloop from="1" to="#FORM.items#" index="i">
<cfset thisname = form["Itemname" & i]>
<cfset thisdesc = form["ItemDesc" & i]>
<cfset thisqty = form["Quantity" & i]>
<cfset thiscode = form["Code" & i]>
<cfset thisprice = form["Price" & i]>
<cfset thisprice = replace("#thisprice#",".","","All")>
<cfquery name="add_items" datasource="#application.db#">
INSERT INTO tblpassInvItems
(invid,itemactive,itemname,itemdesc,itemqty,itemcode,itemprice)
VALUES
(#form.invid#,1,'#thisname#','#thisdesc#',#thisqty#,'#thiscode#','#thisprice#')
</cfquery>
</cfloop>
<cfset invid = form.invid>
<cfinclude template="inv_doc.cfm">
<tr>
<td class="Copy" valign="top">Display all details for invoice:</td>
<td>
</td>
</tr>
<tr>
<td class="copy" valign="top">Download</td>
<td>Download</td>
</tr>
<tr>
<td>
<input type="Submit" name="Submit" value="Submit" class="submitbutton">
<input type="hidden" id="items" name="items" value="1" />
<input type="hidden" name="step" value="5" />
<input type="hidden" name="invid" value="#form.invid#" />
</td>
</tr>
<!---<cfheader name="Content-Disposition" value="attachment;filename=#this_filename#.pdf">
<cfcontent type="application/octet-stream" file="#expandPath('.')#/dynamicdocs/#this_filename#.pdf" deletefile="No">--->
<cfcatch type="any">
<script type="text/javascript">
alert("An error has occured! Please try again later")
</script>
</cfcatch>
</cftry>
</cfif>
<cfif form.step eq 5>
<tr>
<td class="Copy" valign="top" colspan="2">Please complete the following if you would like to send the invoice now or click on finish:</td>
</tr>
<tr>
<td class="Copy" valign="top">Bcc:</td>
<td>
<cfquery name="get_vendors" datasource="#application.db#">
SELECT * FROM tblpassVendor
WHERE vendorActive = 1
AND CompanyID = #session.companyid#
AND VendorID IN (#GetAdmin.AdminVendors#)
</cfquery>
<Select name="bcc">
<cfloop query="get_vendors">
<option value="#vendorbccemail#">#vendorbccemail#</option>
</cfloop>
</Select>
</td>
</tr>
<tr>
<td>
<input type="Submit" name="Submit" value="Submit" class="submitbutton">
<input type="hidden" id="items" name="items" value="1" />
<input type="hidden" name="step" value="6" />
<input type="hidden" name="invid" value="#form.invid#" />
</td>
</tr>
<tr>
<td>Save and Start New Invoice</td>
</tr>
</cfif>
<cfif form.step eq 6>
<cftry>
<cfset invid = form.invid>
<cfinclude template="inv_mail.cfm">
<tr>
<td class="Copy" valign="top" colspan="2">Thank you! Your Invoice has been sent!</td>
</tr>
<tr>
<td class="copy" valign="top"></td>
<td>Finish</td>
</tr>
<cfcatch type="any">
<tr>
<td class="Copy" valign="top" colspan="2">An Error has occured! Your invoice has not been sent</td>
</tr>
</cfcatch>
</cftry>
</cfif>
</cfoutput>
</table>
</form>
<cfinclude template="footer.cfm">
I am not using things like cfqueryparam as this is still being developed and is within a secure environment
Thank you in advance
I used to do something like this (used it long time back, code may be off, but more of an idea):
<cfparam name="form.submitted" default=0>
<cfif structKeyExists(FORM,"submit") AND NOT FORM.submitted>
<!---action code goes here--->
<cfset form.submitted=1>
</cfif>
<form>
<!--- your other form elements--->
<input type="hidden" name="submitted" value="#FORM.submitted#">
</form>
I am not sure, it can help you much in multi-step form, but it helped in single step avoiding multi-submit by setting the flag when the form has been submitted.
You can redirect to the same page, it will avoid re-posting the form.
I have faced similar kind of situation few days back. As per my knowledge the best possible solutions are,
Redirect to some other page for preventing form resubmission.
If redirect is not suitable , the only other option is using AJAX.
I'm using cfloop to dynamically create/fill in three sets of input fields, plus some radio buttons that are used for a rating system. The input fields work as expected. However I'm having trouble with the radio buttons.
For some reason (and I'm assuming it's a simple reason) the radio buttons don't reflect the values being sent to them. For example: Say I have 3 things I am rating. If the looped values are 5,4,3 the radio buttons are all displaying as if the value being passed to them was 5. It's almost as if all of the field sets are created first and all take the first value (e.g. get checked), as opposed to creating the first field set, insert the value, and then create the second field set and so on (like I would assume in a loop). Again, it works for the everything but the radio buttons. Any insight would be greatly appreciated.
Here is my code:
<cfloop query="postedBy" startrow="1" endrow="4">
<cfquery name="score" datasource="myDB">
SELECT Round(sum(leadership)/Count(leadership)) as leadership
, Round(sum(communication)/Count(communication)) as communication
, Round(sum(fairness)/Count(fairness)) as fairness
, Round(sum(ethics)/Count(ethics)) as ethics
, Round(sum(competence)/Count(competence)) as competence
FROM score_base
WHERE score_ID = '#postedBy.score_id#'
</cfquery>
<cfset score_ID=#postedBy.score_id#>
<cfoutput>id: #postedBy.score_id#</cfoutput>
<cfoutput>My score: #score.leadership#, #score.communication#, #score.fairness#, #score.ethics#, #score.competence#</cfoutput>
<cfset counter = counter+1>
<cfset "currentScore#score.leadership#" = "checked">
<cfset "currentScoreb#score.communication#" = "checked">
<cfset "currentScorec#score.fairness#" = "checked">
<cfset "currentScored#score.ethics#" = "checked">
<cfset "currentScoree#score.competence#" = "checked">
...
<div class="rating-wrapper">
<cfform>
<label>Leadership</label>
<cfinput type="radio" class="star" name="leadership" value="1" disabled="disabled" checked = '#currentScore1#'/>
<cfinput type="radio" class="star" name="leadership" value="2" disabled="disabled" checked = '#currentScore2#'/>
<cfinput type="radio" class="star" name="leadership" value="3" disabled="disabled" checked = '#currentScore3#'/>
<cfinput type="radio" class="star" name="leadership" value="4" disabled="disabled" checked = '#currentScore4#'/>
<cfinput type="radio" class="star" name="leadership" value="4" disabled="disabled" checked = '#currentScore5#'/>
</cfform>
</div><!-- END div class="rating-wrapper" -->
<div class="rating-wrapper">
<cfform>
<label>Communication</label>
<cfinput type="radio" class="star" name="communication" value="1" disabled="disabled" checked = '#currentScoreb1#'/>
<cfinput type="radio" class="star" name="communication" value="2" disabled="disabled" checked = '#currentScoreb2#'/>
<cfinput type="radio" class="star" name="communication" value="3" disabled="disabled" checked = '#currentScoreb3#'/>
<cfinput type="radio" class="star" name="communication" value="4" disabled="disabled" checked = '#currentScoreb4#'/>
<cfinput type="radio" class="star" name="communication" value="5" disabled="disabled" checked = '#currentScoreb5#'/>
</cfform>
</div><!-- END div class="rating-wrapper" -->
<div class="rating-wrapper">
<cfform>
<label>Fairness</label>
<cfinput type="radio" class="star" name="fairness" value="1" disabled="disabled" checked = '#currentScorec1#'/>
<cfinput type="radio" class="star" name="fairness" value="2" disabled="disabled" checked = '#currentScorec2#'/>
<cfinput type="radio" class="star" name="fairness" value="3" disabled="disabled" checked = '#currentScorec3#'/>
<cfinput type="radio" class="star" name="fairness" value="4" disabled="disabled" checked = '#currentScorec4#'/>
<cfinput type="radio" class="star" name="fairness" value="5" disabled="disabled" checked = '#currentScorec5#'/>
</cfform>
</div><!-- END div class="rating-wrapper" -->
<div class="rating-wrapper">
<cfform>
<label>Ethics</label>
<cfinput type="radio" class="star" name="ethics" value="1" disabled="disabled" checked = '#currentScored1#'/>
<cfinput type="radio" class="star" name="ethics" value="2" disabled="disabled" checked = '#currentScored2#'/>
<cfinput type="radio" class="star" name="ethics" value="3" disabled="disabled" checked = '#currentScored3#'/>
<cfinput type="radio" class="star" name="ethics" value="4" disabled="disabled" checked = '#currentScored4#'/>
<cfinput type="radio" class="star" name="ethics" value="5" disabled="disabled" checked = '#currentScored5#'/>
</cfform>
</div><!-- END div class="rating-wrapper" -->
....
</cfloop>
Figured it out: The issue was with my dynamic variables. I needed to reset them at the end of the loop:
<cfset "currentScore#score.leadership#" = "0">
<cfset "currentScoreb#score.communication#" = "0">
<cfset "currentScorec#score.fairness#" = "0">
<cfset "currentScored#score.ethics#" = "0">
<cfset "currentScoree#score.competence#" = "0">
</cfloop>