Copy link to clipboard
Copied
Hello,
am actually developing a marker on a site. The marker consists of a tooltip which is in javascript and css. The marker actually will be called on a page by it tag name which I've created. For exemple, the page of the marker is named marker.cfm, when i'll call the marker in another page, this would be like this <sitename:marker></sitename:marker>.
I want to use this marker in a form.
My question is : "Is there some way to detect a form tag in coldfusion ?"
Somebody could help me or give me a tip so that I can proceed further ?
Thanks in advance.
Copy link to clipboard
Copied
Do you mean a way to detect a form on the current page, or on the page from which we've arrived (the referrer page)?
Copy link to clipboard
Copied
On the current page.
Copy link to clipboard
Copied
<form>
<input name="txt1" type="text">
<input name="txt2" type="text">
<input name="txt3" type="text">
</form>
<!--- Read the CFM file of the current page --->
<cffile action="read" file="#expandPath('#cgi.script_name#')#" variable="currentCfmPage">
<!--- Use regular expressions to find form tags on the page --->
<!--- You could also add a similar line of code to find the cfform tag. --->
<cfset findFormtag = REFindNoCase("<form>(.|\s)*</form>",currentCfmPage)>
<cfif findFormtag GTE 1>
<p>There is a form tag on the page</p>
</cfif>