Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Form:
<form>
<button>Add tr to table</button>
<table>
<thead>...</thead>
<tbody>
<tr>...</tr>
...PlaceHolder...
<tbody>
</table>
</form>
Module code: (buttton form and AHAH function)
$form['add']=array(
'#type'=>'button',
'#value'=>'Add Element',
'#ahah'=>array(
'path'=>'nodechild_add_elem',
'method' => 'append',
'wrapper'=>'nodechild_table tbody'
),
);
function module_nodechild_add_elem(){
$output = '<tr>...</tr>';
drupal_json(array('status'=>'TRUE','data'=>$output));
}
Result:
<form>
<button>Add tr to table</button>
<table>
<thead>...</thead>
<tbody>
<tr>...</tr>
<div> // -- unnecessary div
<tr>(output from ahah)</tr>
</div>
<tbody>
</table>
</form>
How i can remove this 'div' element?
Comments
Comment #0.0
divined CreditAttribution: divined commentedmiss
Comment #0.1
divined CreditAttribution: divined commentedmis