I'm using Goutte, https://github.com/fabpot/goutte, and have the following code,
$client = new Client();
$crawler = $client->request('GET', \Config::get('Eload2::url'));
$form = $crawler->selectButton('Submit')->form();
// add extra fields here
$client->submit($form);
how do I do to add hidden input fields to the form before it's submitted?
I tried the following code,
$domdocument = new \DOMDocument;
$formfield = new InputFormField ($domdocument->createElement('__EVENTTARGET', 'ctl00$ContentPlaceHolder1$DDLTelco'));
$formfield2 = new InputFormField ($domdocument->createElement('__EVENTARGUMENT',''));
$form->set($formfield);
$form->set($formfield2);
but the following error message is returned,
An InputFormField can only be created from an input or button tag (__EVENTTARGET given).