One form with many submit buttons with PHP on a New DomDocument -
my domdocument put down 1 submit button. need buttons submits, first 1 , rest turned textareas, though specify "submit".
i know can html, domdocuments prints out 1 submit.
how can have more 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();
Comments
Post a Comment