• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

passing form values to cfhttp request as comma delimited

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
Gurpreet Singh Randhawa
Asked:
Gurpreet Singh Randhawa
1 Solution
 
duncancummingCommented:
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
 
gdemariaCommented:
always remember, don't drink and code :)
0
 
Gurpreet Singh RandhawaWeb DeveloperAuthor Commented:
Thanks! Well i realize that Beer affect my brain a lot. :)
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now