Here's a short function I wrote to implement my own "Back" button. Note that you could also add more buttons using the same scheme. The table allows me to nicely center them on screen.
/* ---------------------------------------------------------
Format and return table with one Back button
------------------------------------------------------- */
function btn_GoBack($Caption = "<< Go Back", $Color="goldenrod")
{
$table_button = "
<TABLE ALIGN = CENTER BORDER=3 CELLPADDING=5 CELLSPACING=5 WIDTH=\"25%\">
<TR>
<TD ALIGN=LEFT BGCOLOR=\"$Color\"><A href=\"javascript: history.go(-1);\"><b>$Caption</b></A></TD>
</TR>
</TABLE>
";
return $table_button;
}
You can easily implement this function and put this button anywhere you want on a form, e.g.,
echo btn_GoBack();
The issue is, the button will do nothing if the user has JS turned off. (Hey, it's a chance we all take, right?) But HTML supports the NOSCRIPT tag for just such an occasion. This allows you to alternately inform the user that they have JS turned off and that the button won't work.
The question is, where do I put the NOSCRIPT tag? I tried placing it inside the function, but it didn't work -- generated an error.