1

The form input name of:

user[subscriptions][1,28][_delete]

Essentially turns into a struct like this:

User

-Subscriptions

--1,28

---_delete

But how can you manually create a struct like this?

You can't do:

<cfset user.subscriptions.1,28._delete = 1>

CF doesn't like the comma in the struct name. But I need to be able to create the struct like this.

Any ideas?

1 Answer 1

8

<cfset user[ 'subscriptions' ][ '1,28' ][ '_delete' ] = 1 />

Array notation lets you get away with all kinds of illegal variable names :)

Sign up to request clarification or add additional context in comments.

1 Comment

DOH! ... I neglected to use quotes ... :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.