• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem with external app doing a POST to a page on my app

New Here ,
May 28, 2007 May 28, 2007

Copy link to clipboard

Copied

Help! I have an app that will be accepting a POST request to a page from an external app, and I have no control over the field names it's submitting. Unfortunately one of them ends with _time, so CF is trying to validate the data? How do I get around this? I'm using CFMX 6.1 on Windows...
TOPICS
Advanced techniques

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jun 13, 2007 Jun 13, 2007
Yes!

Application.cfm will process before the validation so you can trap the problem there. For my Facebook application I'm trapping any forms that include the unique Facebook hidden inputs and redirecting the browser using cflocation with my key-value pairs appended to the end.

But you could also use cfhttp to submit the form and display the cfhttp.filecontent for the user.

Votes

Translate

Translate
Engaged ,
May 28, 2007 May 28, 2007

Copy link to clipboard

Copied

Are you sure it is an issue with a field name "_time"? This is not any sort of built in function that is throwing an error.

You can simply test this buy creating a form with that field name and submitting it.

What error are you receiving?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2007 May 29, 2007

Copy link to clipboard

Copied

I'm going by the CF documentation at live docs that says:

quote:

Any form field name, from the cfform tag or an HTML form, that ends in one of the following suffixes invokes server-side form validation:
and _time is one of the ones listed.

How can I turn this off? I had no idea it did it on a non-CFForm (I never use that for that reason) and it drove me crazy all weekend until I wondered if this validation is what's causing it. I had simplified my page down to just "Testing this" with nothing else on it, and I get this error:

quote:

Form entries incomplete or invalid.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 29, 2007 May 29, 2007

Copy link to clipboard

Copied

angplange wrote:
> Help! I have an app that will be accepting a POST request to a page from an
> external app, and I have no control over the field names it's submitting.
> Unfortunately one of them ends with _time, so CF is trying to validate the
> data? How do I get around this? I'm using CFMX 6.1 on Windows...
>

That is going to be a challenge. I personally do not know of any way to
disable ColdFusion automatic form validation based on field names.

The only thought I have is that you could use some kind of web service
code to rewrite the request headers before it is handed off to
ColdFusion. But that could be tricky.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 30, 2007 May 30, 2007

Copy link to clipboard

Copied

If you can't change the initial form names in the form, change it afterwards.

On your action page or code, check to see if a form field is named '_time', and if so, rename the field to 'newtime' or something like that.

EX:

<cfif form.fieldname eq '_time'>
<cfset form.fieldname = "newtime'>
</cfif>

or somethihg like that...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 30, 2007 May 30, 2007

Copy link to clipboard

Copied

Abinidi wrote:
> If you can't change the initial form names in the form, change it afterwards.
>
> On your action page or code, check to see if a form field is named '_time',
> and if so, rename the field to 'new_time' or something like that.
>
> EX:
>
> <cfif form.fieldname eq '_time'>
> <cfset form.fieldname = "new_time'>
> </cfif>
>
> or somethihg like that...
>

The trouble with this is that with this type of form validation,
ColdFusion intercepts the request before the action page is run and
process predefined validation and then outputs automatic error messages.
I do not know how to have CF not do this when it detects fields with
this naming convention.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: Newsgroup User
angplange wrote:
> Help! I have an app that will be accepting a POST request to a page from an
> external app, and I have no control over the field names it's submitting.
> Unfortunately one of them ends with _time, so CF is trying to validate the
> data? How do I get around this? I'm using CFMX 6.1 on Windows...
>

That is going to be a challenge. I personally do not know of any way to
disable ColdFusion automatic form validation based on field names.

The only thought I have is that you could use some kind of web service
code to rewrite the request headers before it is handed off to
ColdFusion. But that could be tricky.




Yikes, wouldn't even begin to know how to do that-- yep, this will probably be a question asked more and more on here, as this will prevent anyone from using ColdFusion with Facebook's new platform they launched this past Friday. I cannot make an app right now that can integrate with Facebook because of this...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 30, 2007 May 30, 2007

Copy link to clipboard

Copied

Have you tried defining your own validation handler with cferror? If a custom handler overrides the default CF handler, you could code it to do whatever you want.

Look into CFERROR

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: cf_dev2
Have you tried defining your own validation handler with cferror? If a custom handler overrides the default CF handler, you could code it to do whatever you want.

Look into CFERROR


hmm... that's an idea... kludgy, but hey, if I can get my app on Facebook....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

Yes, I think the choices are complicated and kludgy 😉 What about the application.cfc ? If a request hits the OnRequest function before doing server-side validation. Maybe you could do some handling there?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 13, 2007 Jun 13, 2007

Copy link to clipboard

Copied

Yes!

Application.cfm will process before the validation so you can trap the problem there. For my Facebook application I'm trapping any forms that include the unique Facebook hidden inputs and redirecting the browser using cflocation with my key-value pairs appended to the end.

But you could also use cfhttp to submit the form and display the cfhttp.filecontent for the user.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 19, 2007 Jun 19, 2007

Copy link to clipboard

Copied

Thanks Glennpmn, that worked!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jun 19, 2007 Jun 19, 2007

Copy link to clipboard

Copied

LATEST
Thanks everyone else too 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

If you have access to the server, you could technically edit the cfforms.js file in the CFIDE folder and comment out/ edit the "time" validation?

I have not done it before, but would it work?

function _CF_checktime()

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: Abinidi
If you have access to the server, you could technically edit the cfforms.js file in the CFIDE folder and comment out/ edit the "time" validation?

I have not done it before, but would it work?

function _CF_checktime()


dang, tried that, still no go....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

angplange wrote:
>
quote:

Originally posted by: Abinidi
> If you have access to the server, you could technically edit the cfforms.js
> file in the CFIDE folder and comment out/ edit the "time" validation?
>
> I have not done it before, but would it work?
>
> function _CF_checktime()

>
> dang, tried that, still no go....
>

Did you edit out the correct JS function. If you are talking about
_Date I would expect a date function not a time function being the one
that is called.

Also have you investigated ISrewrite(sp) techniques? Creating something
in the web server that intercepted the request and changed the headers
would do this in theory. I just have no idea how one would actually do
this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jun 01, 2007 Jun 01, 2007

Copy link to clipboard

Copied

I don't think modifying cfform.js would help because the problem is server side validation and cfform.js is client-side.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 02, 2007 Jun 02, 2007

Copy link to clipboard

Copied

I send cf_dev2's point. You'll have to try and either:

1) Intercept the data (if you can) in the application.cfc (may not be possible)
2) Modify the CF file that performs the server-side validation (may not be possible)
3) Have the offsite form post to a non-CF page (.NET/PHP) that swaps out the problem field names and forwards it on to you your CF application.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation