This content has been marked as final. Show 12 replies
The best way to handle the effects of a server side error is to prevent the server side error. If the error pertains to inserting a record that is already there, there are many ways to prevent that. Here is one.
insert into yourtable
select distinct yourvalues
where (select count(*)
where some conditions are met) = 0
It really does not pertain to a record that is already there. This was just an example.
I am talking about my edit checks that I wrote when I speak of a server side error.
The problem is that the values in the form entries are truncated. For example, I have a phone number I entered that is 10 digits. After I submit the form the last digit is gone and the phone number moves over a space in the form entry. Other number entries do the same like the SSN number. Seems like only the numbers get truncated.
I am using Firefox and Internet Explorer
THank you for your reply.
How are you returning the data to the form? Does the page self-post? maybe posting some code samples might help diagnose what's going wrong.
The following is the HTML form code -
<td><form name="loanapplication"action="loanapplication.cfm" method="post" target = "_self" onSubmit="return validate(document.loanapplication);"></td>
If you need any other code, please let me know.
Thank you for your reply.
what are the value attributes of your cfinput tags?
Below is a text box for a SSN number:
<input name="ssn1" type="text" id="ssn1" <cfif isdefined("form.ssn1")>
value = "<cfoutput> #form.ssn1#</cfoutput>" <cfelse> value = "<cfoutput>***</cfoutput>"</cfif>size="3" maxlength="4" onKeyUp ="validotherssn(this);" onKeypress="if (event.keyCode < 48 || event.keyCode > 57 ) event.returnValue = false;" />
<input name="ssn2" type="text" id="ssn2" <cfif isdefined("form.ssn2")>value = "<cfoutput> #form.ssn2#</cfoutput>"<cfelse> value = "<cfoutput>**</cfoutput>" </cfif>
size="2" maxlength="3" onkeyup="validotherssn(this);" onKeypress="if (event.keyCode < 48 || event.keyCode > 57 ) event.returnValue = false;" />
<input name="ssn3" type="text" id="ssn3" <cfif isdefined("form.ssn3")>value = "<cfoutput> #form.ssn3#</cfoutput>" <cfelse> value = "<cfoutput>****</cfoutput>"</cfif> onKeyUp="validotherssn(this);" size="4" maxlength="5" onKeypress="if (event.keyCode < 48 || event.keyCode > 57 ) event.returnValue = false;" /> </td>
I would change all of the form and input tags to use CFFORM and CFINPUT , as it will give better formatting and validation.
I changed my form to cfform and all my input tags to cfinput. I am getting the following error message on all text box entries.
Invalid token 'c' found on line 1488 at column 228.
The CFML compiler was processing:
* a cfinput tag beginning on line 1488, column 12.
The error occurred in D:\Testing WEB\loanapplicationtwo.cfm: line 1488
1486 : <tr>
1487 : <td height="40"><strong>Cash Price <span class="style8">*</span></strong></td>
1488 : <td><cfinput type="text" name="cashprice" id="cashprice" onKeyUp="valid(this);" onKeyPress="if (event.keyCode != 46 && event.keyCode < 48 || event.keyCode > 57 ) event.returnValue = false;" size="10" maxlength="10" <cfif isdefined("form.cashprice")>value = "<cfoutput> #form.cashprice#</cfoutput>" <cfelse>value="0.00"</cfif> >
1489 : </td>
1490 : </tr>
I have never used CFform. Why am I getting this message on all text fields?
The "less then" and "greater then" signs (<|>) in your inline JS is
confusing the parser which is thinking they are opening or closing angle
If you want to keep the <cfinput...> tags move your JS into a function
in a script block then call that function from the tags.
You can't nest cftags like this:
You have to do this
Life would be a lot simpler if your rearranged your code. All the if/else and other logical code could be written first. The resulting variables are then used for the value attributes of your form
As noted by Dan, you can't nest cf tags inside cf tags.
What you can do in your case, is change <cfinput to just <input on those tags that you need to use <cfif> in. You can still keep the form tag as <cfform> - it supports regular <input> tags just fine.
To resolve your original issue, remove the SPACE immediately following the opening quote in the VALUE attribute of your form inputs.