The syntax provided expects that:
- You have an HTML form, and
- That form has a field in it named 'title2'
If you do not, it means you erroneously mixed your form.id (which is, in this example, '2') with the form field name 'title', creating the variable 'title2', which is expected to exist in the form scope (from your form submission).
If you do have a field named 'title2' in your form, your code will work. I personally tested it with this simple script of a form that posts to itself:
<cfif isDefined('form.submit')>
<!--- here's your syntax --->
<cfoutput>#form['title'&form.id]#</cfoutput>
</cfif>
<form action="form.cfm" method="post">
<input type="hidden" name="id" value="2" />
<input type="text" name="title2" value="" />
<input type="submit" name="submit" />
</form>
You've somehow come up with an edge condition that may prevent the form field 'title2' from existing. Without further code or explanation, we can't really help beyond this.