Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing a form object to a custom tag

Posted on 2002-07-19
5
Medium Priority
?
148 Views
Last Modified: 2013-12-24
Greetings!
I was wondering if anyone could tell me how to 1)pass a form object to a custom tag 2)access the form data in the custom tag.

Thanks

Nickel
0
Comment
Question by:nickel2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 5

Accepted Solution

by:
CFXPERT earned 900 total points
ID: 7165692
to pass variables to the tag use:

<cf_tagname
ATTRIBUTES
test = 1,
test2 = 2
>

to retrieve attributes in the custom tag use:

#attributes.test#
#attributes.test2#
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7165700
Sorry also if you wanna pass for emelents use:

<cf_embedfields>in between you <form> tags

then in cutom tag you can get them simply by calling their name like #username# or whatever the field name happens to be you need the value from.
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7165855
Any luck yet?
0
 
LVL 6

Expert Comment

by:dash420
ID: 7166250
reference to cfexperts comment to invoke custome tag
attributes is not required. no need to give comma between the atrributes variables.

to pass variables to the tag use:

<cf_tagname test = 1 test2 = 2>

is enough to call any cfm files with name tagname.cfm.

to retrive the value what he was explianed is correct
0
 
LVL 17

Expert Comment

by:anandkp
ID: 7167462
Hi there,

U can use the following code to get to know - how to use cutom tags & play around with them.

let me know incase u ahve some difficulties

K'Rgds
Anand

=======================================================

<HTML>
<HEAD>
     <TITLECustom tag</TITLE>
</HEAD>

<BODY>

<!--- assuming the form is submitted to this page --->

<cfset username="form.username">
<CFSET usepwd = "from.password">

<cf_Tag user="#UserName#" pass="#UsePwd#">

<!--- ========================================================================================================== --->

<!--- code for the tag in a seperate file called tag.cfm - is down below --->

<CFIF ISDEFINED('ATTRIBUTES.User') AND ISDEFINED('ATTRIBUTES.PASS')>

<!--- do ur tag processing here like --->
     <CFQUERY NAME="Check_Reg_Password" DATASOURCE="#IWD_DSN#" DBTYPE="ODBC" username="#IWD_USERNAME#" PASSWORD="#IWD_PASSWORD#">    
          Insert into TblUsers values ('#Attributes.User#','#Attributes.Pass#')
     </CFQUERY>    

</CFIF>

<!--- save this fiel as Tag.cfm --->
<!--- ========================================================================================================== --->

<!--- there u r done --->
</BODY>
</HTML>
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
What You Need to Know when Searching for a Webhost Provider
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question