Can I stop Drupal re-creating a form when it's submitted?

anderrospatters

New Member
I have a booking form that's built using options that are retrieved via a third party API and because of the need to have up to date information the results from the API can't be cached (at least not for very long).The problem I'm having is I've noticed when the form is submitted Drupal is re-calling my _form function which is triggering the API calls again and I'd like to stop it doing that to try and reduce the number of API calls that are made.Obviously if the validation fails it needs to re-draw the form and the API calls will need to be made again but I'm wondering if there's a way to stop it doing this when the form validates so I can stop it making lots of unnecessary calls to the API.Thanks for any help.
 
Back
Top