I want to create a custom tag that has a attribute that ask for a number. like
below...
<cf_makeattributes number="?">
Now say I made that number something like 5
<cf_makeattributesnumber=[b]"5"[/b]>
I would like for the tag to take that number and make 5 attributes called
"Form" in a array from 1 to 5 like below...
<cfset attributes.form = arraynew(1)>
<cfloop index="i" from="1" to="#attributes.number#">
#attributes.form[i]#
</cfloop>
Is it possible to make a tag that ask for a number like 5 and make 5
attributes and within the same tag assign values to those 5 attributes. for
example consider the above.
<cf_makeattributes number="5" attribute1="hi" attribute2="hello"
attribute3="howdy" attribute4="hey" attribute5="HOWE!">
or say i want to make 2 attributes and assign 2 values to those attributes
<cf_makeattributes number="2" attribute1="This tag asked for 2 numbers"
attribute2="and therefore gave me the ability to make 2 attributes">
Ian Skinner - 28 Mar 2007 22:21 GMT
odd requirement.
I would think it would be do able. I would start off with an idea
something like this.
<cfset itterations = 5>
<cfset values="1,2,3,4,5">
<cf_makeattributes number=itterations values=values>
You could do more if you made values a structure or array.
cf_dev2 - 28 Mar 2007 22:28 GMT
I'm not sure I understand your goal. You want to pass in an arbitrary number
of values (1-n) and convert them to an array that is returned to the calling
page.. ?
YourArray[1] = "hello"
YourArray[2] = "world"
Is the order of the values significant?
numerical07 - 28 Mar 2007 23:53 GMT
Ok, Say if I had a form that had 5 input text boxs. And I wanted to insert them
into a database. So I made a tag that was made to help insert forms into
databases easier. This tag is universal and can be used for any type of
database entry. First I would Have to tell the tag how many form entries I
have. I could either make a bunch of attributes that will grab all the values
or I could loop out a array of attributes. Thats my goal
cf_dev2 - 29 Mar 2007 00:41 GMT
> I could either make a bunch of attributes that will grab all the
> values or I could loop out a array of attributes. Thats my goal
I was with you until that line. The term attributes is confusing in this
context. I'm not sure if you're talking about attributes in a generic sense or
the custom tag attribute [i]scope[/i].
Let's try this from a different angle. Can you give a concrete example of
the desired results using this form?
<form>
<input name="username1" value="Alice">
<input name="username2" value="Bob">
<input name="username3" value="Kyle">
<input name="username4" value="Michelle">
<input name="username5" value="Robert">
...
</form>