Solved

passing form values to cfhttp request as comma delimited

Posted on 2009-05-06
3
399 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 15

Author Closing Comment

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

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
looping over JSON Object and insert into query 3 57
IIS url rewrite rule for web application 3 53
ip / url redirect 13 68
whm high memory usage in processes 7 70
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. 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 : Open Page or Post…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now