My DomDocument will only put down 1 submit button. I need all buttons to be submits, but only the first one does and the rest are turned into textareas, even though I specify "submit".
I know i can do this with HTML, but DomDocuments only prints out 1 submit.
How can I have more then 1 submit button:
Code:
$tSForm = new DOMDocument;
$tSFRoot = $tSForm->createElement('Form', '');
$tSFId = $tSForm->createAttribute('ID');
$tSFId->value = 'tSFORM';
$tSFRoot->appendChild($tSFId);
$tSFAction = $tSForm->createAttribute('Action');
$tSFAction->value = $_SERVER['PHP_SELF'];
$tSFRoot->appendChild($tSFAction);
$tSFMethod = $tSForm->createAttribute('Method');
$tSFMethod->value = 'POST';
$tSFRoot->appendChild($tSFMethod);
/// Create Button 1
$tSFB1 = $tSForm->createElement('Input','');
$tSFB1Type = $tSForm->createAttribute('type');
$tSFB1Type->value = 'submit';
$tSFB1->appendChild($tSFB1Type);
$tSFB1Name = $tSForm->createAttribute('name');
$tSFB1Name->value = 'print';
$tSFB1->appendChild($tSFB1Name);
$tSFB1Name = $tSForm->createAttribute('value');
$tSFB1Name->value = 'PRINT';
$tSFB1->appendChild($tSFB1Name);
$tSFRoot->appendChild($tSFB1);
/// Create Button 2
$tSFB2 = $tSForm->createElement('Input','');
$tSFB2Type = $tSForm->createAttribute('type');
$tSFId->value = 'submit';
$tSFB2->appendChild($tSFB2Type);
$tSFB2Name = $tSForm->createAttribute('name');
$tSFB2Name->value = 'newTS';
$tSFB2->appendChild($tSFB2Name);
$tSFB2Name = $tSForm->createAttribute('value');
$tSFB2Name->value = 'New Time Sheet';
$tSFB2->appendChild($tSFB2Name);
$tSFRoot->appendChild($tSFB2);
/// Create Button3
$tSForm->appendChild($tSFRoot);
echo $tSForm->saveHTML();