Ask a Question related to Macromedia ColdFusion, Design and Development.
-
bkendall #1
Help with form/display
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
<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["frmEdit
Areas"]["txtContactPhone2"].value+document.forms["frmEditAreas"]["txtContactPhon
e3"].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("SFBOutsid e",
"State")# #REQUEST.GetEditArea("SFBOuts ide", "Zip")#
<cfelse>
<br>
#REQUEST.GetEditArea("SFBOutside",
"City")#, #REQUEST.GetEditArea("SFBOutsid e",
"State")# #REQUEST.GetEditArea("SFBOuts ide", "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>
bkendall Guest
-
Flash Form won't display
I have an issue that when I add a cfinput tag such as checkbox to a flash form, the form stops appearing. See code attached. Code that works: ... -
Flash Form doesn't display
We have CF MX 7 multi-server configuration on Windows 2003 server. Recently we applied the Windows NTLM Authentication to our web site based on... -
Search and display in same form
Anon wrote: Not a particularly unusual feature in a comprehensive application. If there are only a few data fields, you could use the data... -
Date display on a form
This is really strange. I have two databases created in Access and I used the 'Insert' then 'Date and Time' to insert the current date on the main... -
form display
I have a form with a datagrid and a few text boxes - these are populated by a recordsource When the form opens it does not display correctly - if... -
MikerRoo #2
Re: Help with form/display
You're going to have to be more specific.
The posted code references no form variables (directly). Is this a FuseBox
application?
The code sets several form tags but does not contain a form or cfform tag.
Is this the page that doesn't display correctly or is the page, that processes
this form, the problem?
Please post exactly what is displayed versus what is desired.
Regards,
-- MikeR
MikerRoo Guest



Reply With Quote

