Use the on dialog sclick event for those two buttons to perform a /dialog -c $dname (or /dialog -x $dname). You'll need to look up these things in the help file for more details.