i tried `structKeyExists(form, 'search.value')` b...
# cfml-general
s
i tried
structKeyExists(form, 'search.value')
but its no all time
t
you can try dumping
form
and seeing what it shows up as. It's not clear to me what you're expecting the key to be. if the key is
search[value]
then searching for
search.value
shouldn't work. But
structKeyExists(form, "search[value]")
might...
☝🏾 1
☝️ 2
a
search[value]
is not the same as
search.value
. The former indicates the name of the element is stored in a variable called
value
and the latter indicates the name of the element is
value
. This is pretty fundamental knowledge for you to know, so... best go read some docs: https://helpx.adobe.com/uk/coldfusion/developing-applications/the-cfml-programming-language/using-arrays-and-structures/about-structures.html As per usual, if you show us what the data is (ie: a cfdump), then that will clarify things. I mean even you looking at the dump of the data will probably enable you to answer yer own question?
s
i do not have dump, i have data in the request as
a
It would take minimal effort on your part to do
<cfdump var="#form#">
and then you would clearly see how CF handles form fields named that way.
💯 3