質問

I've got an issue with a ColdFusion form which as per direction from management must use CF's form validation.

We need to submit data via an ajax request after the form has validated as true, and I've Googled how to use cfform validation but haven't been able to find out how to wait until ColdFusion has done validating the form via its on JS.

Is there some kind of object I can pass into my jQuery function to see if it returns true so I can then process my additional ajax requests?

役に立ちましたか?

解決

To do exactly what you say you want to do, code like this should work.

<cfform action="abc.cfm"
method="post"
onsubmit="return someJSFunction(this)">

The function, someJSFunction() will run after your form validates. However, you might be doing things the hard way. Instead of doing ajax requests to submit data, it would probably be a lot easier to submit that data with ColdFusion code in the form action page, abc.cfm in this example.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top