Update a Form from Grid (master Detail)

I have un form and Grid app in a master/details relationship.
I would like to update a field of form from the Grid.
The grid has a ajax button for add a value.
I tried with
?>

but it always show a windows(yellow) like execute un echo but it doesn’t update.
Is ther any way to do it.?
thanks