4 Replies Latest reply on Mar 21, 2007 12:41 PM by scooter5791

    Submit Button

    tapping Level 1
      In my form i created in Dreamweaver using Coldfusion. When I am entering data, Somtimes my Submit button does not show on the form. What could possibly cause this to happen?
        • 1. Re: Submit Button
          Level 7
          Bad HTML code?

          Would really need to see the page code to help.

          --
          Ken Ford
          Adobe Community Expert
          Fordwebs, LLC
          http://www.fordwebs.com


          "tapping" <webforumsuser@macromedia.com> wrote in message news:es7c4g$5an$1@forums.macromedia.com...
          > In my form i created in Dreamweaver using Coldfusion. When I am entering data, Somtimes my Submit button does not show on the
          > form. What could possibly cause this to happen?

          • 2. Submit Button
            tapping Level 1
            Ken,

            Below is the code. I had to delete a lot of the code before I could send it (like javascript functions, Form elements, and query updates. )

            <cfif isdefined("session.businessnum")>
            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
            " http://www.w3.org/TR/html4/strict.dtd">
            <html>
            <cfquery name = "getloanseq" datasource="ezloanchfs" >
            select loanseq from counters
            </cfquery>
            <cfset newinternalid = val(#getloanseq.loanseq#) + 1>
            <cfif #getloanseq.loanseq# lt 100000>
            <cfset newinternalid = '0' & newinternalid>
            </cfif>
            <head>
            <link href="css/chfsstyles.css" rel="stylesheet" type="text/css" >
            <CFINCLUDE template="application.cfm">
            <cfinclude template="chfsmenu.cfm">
            <SCRIPT LANGUAGE="JavaScript" type="text/javascript">

            </script>
            </head>
            <body onLoad="document.loanapplication.loancategory.focus();if (document.loanapplication.second.value == 'Yes')applyDisplay('');if(document.loanapplication.second.value == 'Yes')applyDisplaytwo('');if (document.loanapplication.third.value == 'Yes')applyDisplaythree('');if (document.loanapplication.third.value == 'Yes')applyDisplayfour(''); while(''+document.loanapplication.email.value.charAt(0)==' ')document.loanapplication.email.value=document.loanapplication.email.value.substring(1,d ocument.loanapplication.email.value.length);while(''+document.loanapplication.secondaryema il.value.charAt(0)==' ')document.loanapplication.secondaryemail.value=document.loanapplication.secondaryemail.v alue.substring(1,document.loanapplication.secondaryemail.value.length);while(''+document.l oanapplication.thirdemail.value.charAt(0)==' ')document.loanapplication.thirdemail.value=document.loanapplication.thirdemail.value.sub string(1,document.loanapplication.thirdemail.value.length);while(''+document.loanapplicati on.ssn1.value.charAt(0)==' ')document.loanapplication.ssn1.value=document.loanapplication.ssn1.value.substring(1,doc ument.loanapplication.ssn1.value.length);while(''+document.loanapplication.ssn2.value.char At(0)==' ')document.loanapplication.ssn2.value=document.loanapplication.ssn2.value.substring(1,doc ument.loanapplication.ssn2.value.length); while(''+document.loanapplication.ssn3.value.charAt(0)==' ')document.loanapplication.ssn3.value=document.loanapplication.ssn3.value.substring(1,doc ument.loanapplication.ssn3.value.length);" >
            <h3 align="center"><strong>Loan Application</strong></h3>
            <tr>
            <td>
            <form name="loanapplication" action="loanapplication.cfm" method="post" onSubmit="return validate(document.loanapplication);" >
            </td>
            </tr>
            <table id="tableone" width="59%" align="center" border="3" style="display:inline-table" bordercolor= "#006666" color= "#006666">

            <td height="40"><strong>Date of Loan </strong><span class = "style5"> (i.e.mm/dd/yyyy) </span></td>
            <td><input name="dateofloan" value = " <cfoutput>#dateformat(mdate,'mm/dd/yyyy')#</cfoutput>" type="text" id="dateofloan" size="11" maxlength="11" readonly></td>
            </tr>
            <th height="44" align="left" scope="row"><p>Previous Employer Phone <span class="style5" >(i.e.0000000000)</span></p></th>
            <td><input name="thirdpreviousemployerphone" onKeyUp="validother(this);" type="text" id="thirdpreviousemployerphone" <cfif isdefined("form.thirdpreviousemployerphone")> value = "<cfoutput> #form.thirdpreviousemployerphone#</cfoutput>" </cfif> size="10" maxlength="10" onKeypress="if (event.keyCode < 48 || event.keyCode > 57 ) event.returnValue = false;" >
            </td>
            </tr>
            <tr>
            <th align="left" nowrap="nowrap" scope="row">Source of Other Income
             </th>
            <td><input name="thirdotherincomesource" type="text" id="thirdotherincomesource" <cfif isdefined("form.thirdotherincomesource")>value = "<cfoutput> #form.thirdotherincomesource#</cfoutput>" </cfif> size="20" maxlength="20" >
            </td>
            </tr>
            </table>
            <input type="submit" value="Submit" >
            </form>
            <cfset error = false>
            <cfset errmessage = arraynew(1)>

            <!--- End Insert, update voefile --->
            <cfquery name = "getapplicationdata" datasource="ezloanchfs" >
            select [xinternal id], [xloan num] as loannum , [xb1 first name], [xb1 last name] from applications
            where [xinternal id] = #newinternalid# and [xloan num] = '#newloannumber#'
            </cfquery>
            <cfquery name = "getloanfortesting" datasource="ezloanchfs" >
            select [xinternal id], [xloan num] as loannum , [xb1 first name] as fname, [xb1 last name] as lname from applications
            where [xinternal id] = #newinternalid# and [xloan num] = '#newloannumber#'
            </cfquery>
            <script language="javascript" type="text/javascript">
            <cfoutput query="getloanfortesting">

            var msgs = new Array();

            msgs[0] = "#loannum#";
            msgs[1] = "#ucase(fname)#";
            msgs[2] = "#ucase(lname)#";
            </cfoutput>
            alert( "Loan Number " + msgs[0] + " has been assigned to " + msgs[1] + " " + msgs[2] + ". You will be re-directed to the CHFS Menu!")
            document.location.href = "chfsmenu.cfm";

            </script>
            <span class="style2"><b> <cfoutput>Loan Number #newloannumber# has been assigned to #ucase(form.fname)# #ucase(form.lname)#.</cfoutput> </b></span>
            </cfif>
            </cfif>
            </cfif>
            </body>
            </html>
            </cfif>
            • 3. Re: Submit Button
              Karthik_Nataraj
              I don't see any issue with the submit button, but while trimming the code you have removed lots of <CFIF>. If either one is false you might not have executed the whole block. I would recommend to debug step by step using <cfdump> to find where is the code is skipped.
              • 4. Re: Submit Button
                scooter5791
                Well, for one thing your html is not well-formed. This could be because you had to remove much of your code to post the skeleton of it here. For instance, you have your form tag starting inside a <td> tag but your form ends after the table ends. Actually, the <tr><td>...</td></tr> you have the form tag inside is not even in a <table> tag. It will help in lots of ways to correct this and may be causing the issue because it confuses the browser as to how to display the page. It's really hard to tell since the code you posted is admittedly not the entire page code - but it doesn't look to me like a CF issue from what I see here.

                On an unrelated not, you may also find it helpful to build your body onload statements and store the content dynamically in a CF variable before starting the body tag . Then you could simply do:

                <cfoutput>
                <body onLoad="#onload_statement#">
                .....page code
                </body>
                </cfoutput>