For our CiviCRM instance, I use to create forms that allow the user to execute some specific tasks. Typically they end up on a form, they enter some values, and the postProcess function executes some API calls based on what the user entered in the form.

Now I read in the wiki that the use of forms is discouraged, and that I should use a web page and use Ajax. But I have little experience using javascript in my forms, so I wonder whether there exists some kind of tutorial that shows the best practices for doing this. Or is there a particular existing page in CiviCRM (or an extension) that I can look at? Or maybe someone gave a talk at some Civicon that has been recorded?

Any input is greatly appreciated.

1 Answer 1


As far as I know - If you dont need any specific action to be done on the form which you have created before you hit the submit button then you should be alright

For example: If you enter a Postcode on the form and you need to populate address line of the postcode before submission then you need to write AJAX to fetch the records from Database

Links for civicrm Ajax: references



Also you can find a good example of Ajax used in the below extension


I guess this helps !!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.