I am using php to fill up a form. Now, it so happens that form is using ajax for many of its fields.
e.g.
select [country]
(ajax will show drop-down filled with states for that country)
select [states]
(ajax will show drop-down filled with cities)
select [city]
(ajax will enable a submit button)
If it is a simple html based form, it can be easily filled with cURL. But what if the form is using ajax to populate the drop-down fields.
Thanks
When you are “populating” the form with curl, you are actually POSTing the data that would have been typed/entered into the form.
There is no need for the Ajax requests to be made, as long as you know what data you have to use.
So, the solution would be to :
In the end, your curl request should be the same than the one made by the browser when the form is submitted — independantly of the Ajax requests that are sent before (those are only useful for getting data)
Well, that is unless the Ajax requests are actually “writting” something on the server — but that’s pretty rare for this kind of situation.