| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| At server side I want to check form collection or Url collection. I used cfdump to know content of "FORM" and "URL" , it shows me struct[empty strings]. How I would determin these structures are empty? I used isdefined("FORM") but it is not working. Is there any way to determing FROM and URL string are empty or set? Thaks in advance ThePolarExpress............ :light; |
|
#2
| |||
| |||
| structkIsEmpty() OR structCount() will probably work for what you want. |
|
#3
| |||
| |||
| I believe the FORM and URL structures always exist. To determine if they are empty, try the StructIsEmpty function. http://livedocs.adobe.com/coldfusion...s/00000643.htm |
|
#4
| |||
| |||
| > I used isdefined("FORM") but it is not working. Well they always exist, so that's not the best approach. > Is there any way to determing > FROM and URL string are empty or set? Have a read through the docs for functions relating to structures. structCount() is probably the closest one to what you're asking. Or structKeyArray() or something. -- Adam |
|
#5
| |||
| |||
| Thanks a lot ... Form and url structure not exist if you visit server side processing page directly. So before refering these varaibles code you have to varify there existance. I check with structIsEmpty() but it didn't work out . Getting soem java.map interface error. I achives same result by checking isdefined("form.fieldnames"). But this doesn't work for URL. Anybody having any idea how to verify URL is empty or not? Thanks The PolarExpress... :music; <cfif isdefined("form.fieldnames") is false> <cfoutput>"this is test"</cfoutput> <cfif isdefined("URL") is false > <cfoutput><br>"this is url test"</cfoutput> <cfelse> <cfoutput><br>"Exist this is url test"</cfoutput> </cfif> <cfelse> <CFOUTPUT> <hr> <li>#FORM.fieldnames#</li> <li>Last Name:#htmleditformat(form.lastname)#</li> <li>First Name:#form.firstname#</li> <li>Gender:#form.gender#</li> <li>Salary:#form.salary#</li> <br><br> <cfloop index="Item" list=#FORM.fieldnames#> #Item# <Br> </cfloop> </CFOUTPUT> </cfif> |
|
#6
| |||
| |||
| [q]Originally posted by: thepolarexpress Thanks a lot ... Anybody having any idea how to verify URL is empty or not? [/q] len(cgi.querystring) |
|
#7
| |||
| |||
| [q]Originally posted by: Dan Bracuk [Q]Originally posted by: thepolarexpress Thanks a lot ... Anybody having any idea how to verify URL is empty or not? [/Q] len(cgi.querystring) [/q] This doesn't work for URL, when form posted with "GET" method then len(cgi.querystring) is zero. Also Why I am getting an error The value of the parameter 1, which is currently "URL", must be a interface java.util.Map value while checking StructIsEmpty("URL") |
|
#8
| |||
| |||
| > Form and url structure not exist if you visit server side processing page > directly. I don't understand what you mean by that. As opposed to "indirectly"? -- Adam |
|
#9
| |||
| |||
| 1. data input form cfm 2. data process from cfm Thanks !! Ther is possiblity in my application user come to data process form without visiting data input form. In that case my application throwing an error beacuse I am not verify Form and URL filed are empy. so my question is how do we check weather FORM and URL contain any fields or not. I found soln for FORM but not for URL. The URL doesn't have property like fieldnames. So question here How do you identify URL contain anything or it is a blank. p.s. My application problem can be resolved other ways i.e. by checking http referer or there are other ways around... Thanks in advance .. The Polar Express :clock; |
|
#10
| |||
| |||
| [q]Originally posted by: thepolarexpress Thanks !! 1. data input form cfm 2. data process form cfm Ther is possiblity in my application user come to data process form without visiting data input form. In that case my application throwing an error beacuse I am not verify Form and URL filed are empy. so my question is how do we check weather FORM and URL contain any fields or not. I found soln for FORM but not for URL. The URL doesn't have property like fieldnames. So question here How do you identify URL contain anything or it is a blank. p.s. My application problem can be resolved other ways i.e. by checking http referer or there are other ways around... Thanks in advance .. The Polar Express :clock;[/q] |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.