Solved

Passing a form object to a custom tag

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

12 Experts available now in Live!

Get 1:1 Help Now