Solved

Passing a form object to a custom tag

Posted on 2002-07-19
5
147 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 300 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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