Solved

passing form values to cfhttp request as comma delimited

Posted on 2009-05-06
3
401 Views
Last Modified: 2013-12-24
hi experts. too much beer and my lost mind. i have a form field. a select menu where i can select multiple items. on the click of a button, i want to pass the selected items as a comma delimited list. i am confused, i tried using a loop but it failed:

here is what i tried.
<cfloop list="form.selectusers" index="k">
  <cfhttp url="http://smslane.com/vendorsms/pushsms.aspx?user=abc&password=xyz&msisdn=#k#&sid=WebSMS
&msg=#form.message#&fl=0"></cfhttp>  
</cfloop>
 
but i want to pass something like this:
 
  <cfhttp url="http://smslane.com/vendorsms/pushsms.aspx?user=abc&password=xyz&msisdn=996734673,99374673,7364387483&sid=WebSMS
&msg=#form.message#&fl=0"></cfhttp>  
 
like multiple mobile numbers using comma separation. how can i do that. plea guide me

Open in new window

0
Comment
3 Comments
 
LVL 16

Accepted Solution

by:
duncancumming earned 500 total points
ID: 24318451
Firstly, you're missing # # in your cfloop, should be:
<cfloop list="#form.selectusers#" index="k">


But, if form.selectusers is a list of multiple items, you don't even need that loop.  Just try:
  <cfhttp url="http://smslane.com/vendorsms/pushsms.aspx?user=abc&password=xyz&msisdn=#form.selectusers#&sid=WebSMS&msg=#form.message#&fl=0"></cfhttp>  



0
 
LVL 39

Expert Comment

by:gdemaria
ID: 24318747
always remember, don't drink and code :)
0
 
LVL 16

Author Closing Comment

by:Gurpreet Singh Randhawa
ID: 31578664
Thanks! Well i realize that Beer affect my brain a lot. :)
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

809 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