Solved

Passing a form object to a custom tag

Posted on 2002-07-19
5
143 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ColdFusion Rereplace 3 78
How to stress test an ASP.NET https website 3 71
Nameserver and MX Record 2 70
Moving web servers into a DMZ? 3 56
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now