If you want this done on the server side, you can set the title as a variable. Depending on your condition, you can then set the variable (title) to what you want. It's hard to tell exactly what you want to do, but a simple example of doing this--on the server side--using ColdFusion would be:
<cfparam name="title" default="No Title" type="string" />
<cfif isDefined("FORM.myName") AND FORM.myName NEQ "No Title">
<cfset title = FORM.myName&"'s Page" />
</cfif>
<cfoutput>
<html>
<head>
<title>#title#</title>
</head>
<body>
<form name="formName" action="thispage.cfm" method="post">
<label for="myName">Name: </label>
<input type="text" id="myName" name="myName" value="" />
<input type="submit" />
</form>
</body>
</html>
</cfoutput>
<cfparam name="title" default"No Title" type="string" />
sets the default title value when the page first loads. The default title will be No Title. When a user enters a name on the form, and submits the form back to itself, the title will change to the value they entered. For example, if the user enters Tom, then submits the form, the title will change from No Title to Tom's Page.