Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there some way to detect a form tag in coldfusion ?

Community Beginner ,
Jan 24, 2012 Jan 24, 2012

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.

685
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2012 Jan 24, 2012

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)?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 24, 2012 Jan 24, 2012

On the current page.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2012 Jan 25, 2012
LATEST

<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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources