Help with form/display

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default 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")#,&nbsp;#REQUEST.GetEditArea("SFBOutsid e",
    "State")#&nbsp;&nbsp;#REQUEST.GetEditArea("SFBOuts ide", "Zip")#
    <cfelse>
    <br>
    #REQUEST.GetEditArea("SFBOutside",
    "City")#,&nbsp;#REQUEST.GetEditArea("SFBOutsid e",
    "State")#&nbsp;&nbsp;#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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</td>
    <td>&nbsp;</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">&nbsp;</td>

    bkendall Guest

  2. Similar Questions and Discussions

    1. 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: ...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139