I am fairly new to cf but felt this wasn't really a "getting started" question. I was thrown into this project with tons of legacy and little doc, so any help would be greatly appreciated. the trouble I am having is getting information from form fields to display in the tokens above.
thanks in advance for any help
Code:
<cfparam name="ATTRIBUTES.AfterSubmitAction" type="string" default="">
<cfparam name="ATTRIBUTES.Edit" type="boolean">
<cfset BasePath = "/Packages/#session.customercode#/HCI0102A">
<cfset ImagesPath = "#BasePath#/SFBOutside/#Session.Resolution#/">
<style type="text/css">
td img {display: block;}
.style2 {
font-size: 18px
background-color: #FFFFCC;
background-color: #FFFFCC;
}
.style3 {
font-size: 14px;
font-weight: bold;
}
.style4 {
font-size: 14px;
font-weight: bold;
margin: 5px;
background-color: #FFFFCC;
}
</style>
<script type="text/javascript">
function updatephone()
{
document.forms["frmEditAreas"]["txtContactPhone"].value = document.forms["frmEditAreas"]["txtContactPhone1"].value+document.forms["frmEditAreas"]["txtContactPhone2"].value+document.forms["frmEditAreas"]["txtContactPhone3"].value;
}
function SetUpdate(tObj, tHidObj)
{
if (document.forms["frmEditAreas"]["hidChangeMade"].value == "N")
{
if (tObj.value != "")
{
document.forms["frmEditAreas"][tHidObj].value = tObj.value;
}
}
}
function CheckUpdate(tObj, tHidObj)
{
if (document.forms["frmEditAreas"]["hidChangeMade"].value == "N")
{
if (tObj.value != "")
{
if (tObj.value != document.forms["frmEditAreas"][tHidObj].value)
{
alert('Please be sure to click "Preview Changes" in order to update and/or save your changes.');
document.forms["frmEditAreas"]["hidChangeMade"].value = "Y";
}
}
}
}
</script>
<!--Fireworks MX 2004 Dreamweaver MX 2004 target. Created Thu Jun 30 15:34:10 GMT-0400 (Eastern Daylight Time) 2005-->
<cfoutput>
<table width="740" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<th colspan="3" scope="col"><img name="component_r1_c1" src="#ImagesPath#component_r1_c1.jpg" width="740" height="117" border="0" id="component_r1_c1" alt="" /></th>
</tr>
<tr valign="top">
<td width="258"><img name="component_r2_c1" src="#ImagesPath#component_r2_c1.jpg" width="254" height="31" border="0" id="component_r2_c1" alt="" /> </td>
<td width="77" bgcolor="##FFFFCC"><div align="center" class="style3">#REQUEST.GetEditArea("SFBOutside", "Coupon Expiration")#</div></td>
<td width="405"><img name="component_r2_c6" src="#ImagesPath#component_r2_c6.jpg" width="414" height="31" border="0" id="component_r2_c6" alt="" /></td>
</tr>
<tr valign="top">
<td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<th width="26%" scope="col"><p align="center"><img name="component_r3_c2" src="#ImagesPath#component_r3_c2.jpg" width="191" height="332" border="0" id="component_r3_c2" alt="" /><span class="style2">
<cfset lPhone = #REQUEST.GetEditArea("SFBOutside", "Phone")#>
<cfif len(lPhone) is 10>
<cfset displayphone = left(lPhone,3) &"-"& mid(lPhone,4,3) &"-"& right(lPhone,4)>
<cfelse>
<cfset displayphone = lPhone>
</cfif>
#REQUEST.GetEditArea("SFBOutside", "Local Area")# - #displayphone#</span></p>
<p><img name="component_r9_c1" src="#ImagesPath#component_r9_c1.jpg" width="199" height="58" border="0" id="component_r9_c1" alt="" /></p></th>
<th width="1%" scope="col"><img name="component_r3_c3" src="#ImagesPath#component_r3_c3.jpg" width="4" height="424" border="0" id="component_r3_c3" alt="" /></th>
<th width="73%" scope="col"><div align="left"><img name="component_r3_c4" src="#ImagesPath#component_r3_c4.jpg" width="537" height="12" border="0" id="component_r3_c4" alt="" /><span class="style4">
#REQUEST.GetEditArea("SFBOutside", "Address1")#
<cfif #REQUEST.GetEditArea("SFBOutside", "Address2")# neq "">
<br>
#REQUEST.GetEditArea("SFBOutside", "Address2")#
<br>
#REQUEST.GetEditArea("SFBOutside", "City")#, #REQUEST.GetEditArea("SFBOutside", "State")# #REQUEST.GetEditArea("SFBOutside", "Zip")#
<cfelse>
<br>
#REQUEST.GetEditArea("SFBOutside", "City")#, #REQUEST.GetEditArea("SFBOutside", "State")# #REQUEST.GetEditArea("SFBOutside", "Zip")#
</cfif>
</span></div></th>
</tr>
</table></td>
</tr>
</table>
<cfif #ATTRIBUTES.Edit# EQ True>
<input type="hidden" name="hidChangeMade" value="N">
<br>
<table width="770" align="center" cellpadding="4" cellspacing="0" border="0">
<tr>
<td width="20" align="right"> </td>
<td align="right">Coupon Expiration Date</td>
<td><cfset strTemp = #REQUEST.GetEditArea("SFBOutside", "Coupon Expiration")#>
<input type="text" name="txtCouponExpiration" value="#strTemp#" class="txtbox" onFocus="SetUpdate(this, 'hidCouponExpiration');" onBlur="CheckUpdate(this, 'hidCouponExpiration');">
<input type="hidden" name="hidCouponExpiration" value="">
</td>
</tr>
<tr>
<td width="20" align="right"> </td>
<td width="300" align="right">Address Line 1</td>
<td width="450"><cfset strTemp = #REQUEST.GetEditArea("SFBOutside", "Address1")#>
<input type="text" name="txtAddress1" value="#strTemp#" maxlength="50" class="txtbox150" onFocus="SetUpdate(this, 'hidAddress1');" onBlur="CheckUpdate(this, 'hidAddress1');">
<input type="hidden" name="hidAddress1" value="">
</td>
</tr>
<tr>
<td width="20" align="right"> </td>
<td align="right">Address Line 2</td>
<td><cfset strTemp = #REQUEST.GetEditArea("SFBOutside", "Address2")#>
<input type="text" name="txtAddress2" value="#strTemp#" maxlength="50" class="txtbox" onFocus="SetUpdate(this, 'hidAddress2');" onBlur="CheckUpdate(this, 'hidAddress2');">
<input type="hidden" name="hidAddress2" value="">
</td>
</tr>
<tr>
<td width="20" align="right"> </td>
<td align="right">City</td>
<td><cfset strTemp = #REQUEST.GetEditArea("SFBOutside", "City")#>
<input type="text" name="txtCity" value="#strTemp#" maxlength="30" class="txtbox" onFocus="SetUpdate(this, 'hidCity');" onBlur="CheckUpdate(this, 'hidCity');">
<input type="hidden" name="hidCity" value="">
</td>
</tr>
<tr>
<td width="20" align="right"> </td>
<td align="right">State</td>
<td><cfset strTemp = #REQUEST.GetEditArea("SFBOutside", "State")#>
<select name="txtState" onFocus="SetUpdate(this, 'hidState');" onBlur="CheckUpdate(this, 'hidState');">
<!---<cfmodule name="CreateStateList" SelectedState="#strTemp#">--->
<cfmodule template="/CustomTags/CreateStateList.cfm" SelectedState="#strTemp#">
</select>
<input type="hidden" name="hidState" value="">
</td>
</tr>
<tr>
<td width="20" align="right"> </td>
<td align="right">Zip</td>
<td><cfset strTemp = #REQUEST.GetEditArea("SFBOutside", "Zip")#>
<input type="text" name="txtZip" value="#strTemp#" maxlength="5" class="txtbox" onFocus="SetUpdate(this, 'hidZip');" onBlur="CheckUpdate(this, 'hidZip');">
<input type="hidden" name="hidZip" value="">
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="right"> Phone</td>
<td><cfset strTemp = #REQUEST.GetEditArea("SFBOutside", "Phone")#>
<cfset lcPH1 = left(strTemp,3)>
<cfset lcPH2 = mid(strTemp,4,3)>
<cfset lcPH3 = right(strTemp,4)>
<input type="text" name="txtContactPhone1" value="#lcPH1#" maxlength="3" class="smalltxtbox" onfocus="SetUpdate(this, 'hidContactPhone1');" onblur="updatephone(); CheckUpdate(this, 'hidContactPhone1');" />
-
<input type="hidden" name="ContactPhone1" value="" />
<input type="text" name="txtContactPhone2" value="#lcPH2#" maxlength="3" class="smalltxtbox" onfocus="SetUpdate(this, 'hidContactPhone2');" onblur="updatephone(); CheckUpdate(this, 'hidContactPhone2');" />
-
<input type="hidden" name="ContactPhone2" value="" />
<input type="text" name="txtContactPhone3" value="#lcPH3#" maxlength="4" class="smalltxtbox" onfocus="SetUpdate(this, 'hidContactPhone3');" onblur="updatephone(); CheckUpdate(this, 'hidContactPhone3');" />
<input type="hidden" name="ContactPhone3" value="" />
<input type="hidden" name="txtContactPhone" value="#strTemp#" class="txtbox" />
</td>
</tr>
<tr>
<td width="20"> </td>
<td> </td>
<td><input name="chkBrochureAddress" type="checkbox" id="chkBrochureAddress"
value="true" <cfif #REQUEST.IsEditAreaNewDefault("SFBOutside", "Address1")# EQ "true"> checked</cfif>
onClick="javascript:document.frmEditAreas.submit()">
Save changes as new default upon completion of this order</td>
</tr>
<tr>
<td width="20"> </td>
<td> </td>
<td><input name="Submit" type="submit" value="Preview Changes">
</td>
</tr>
<tr>
<td width="20"> </td>
<td colspan="2" bgcolor="##315A88"><!--- Must assign the result of the function to a variable THEN use that variable in the textarea,
if not then leading spaces and crlf's for some reason get inserted and cause problems. --->
</td>
</tr>
</table>
</cfif>
</cfoutput>