I created this example and, suprisingly it works:
<cfform>
<cfinput type="text" name="websiteTitle">
<cfinput type="submit" name="submit">
</cfform>
<cfif isDefined("form.submit")>
<cfset websiteTitle = form.websiteTitle>
<cfelse>
<cfset websiteTitle = "no_title">
</cfif>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<cfheader name="Cache-Control" value="no-cache,no-store,must-revalidate">
<cfheader name="Pragma" value="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="/styles/stylesheet.css"/>
<title>
<cfoutput>#websiteTitle#</cfoutput>
</title>
</head>
<body>
</body>
I cannot post my exact case example, as it is pulling data from the database...
Maybe the reason for this to work is that I put the form ABOVE the header...
Regarding:
I cannot post my exact case example, as it is pulling data from the database...
Maybe the reason for this to work is that I put the form ABOVE the header...
The position of the form is irrelevent. All that matters is that you set the variable before you attempt to use it.
To move forward, I suggest starting with the page that works, and start adding bits from the page that doesn't work until you have completely re-assembled it. And remember, test early, test often, and test again.