문제

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