I have a web form, something like:
<form>
<input type="text" name="objectives" value="This is a test">
<input type="text" name="objectives" value="And another, if you know what I mean.">
<input type="text" name="objectives" value="And yet another.">
<input type="submit" name="btnGo" value="Do It">
</form>
And an action page that submits it to a db. The trouble is, the objectives will have commas in them, occasionally, and CF turns each comma into a list item, so my loop looks like:
- This is a test
- And another
- if you know what I mean
- And yet another
but I want:
- This is a test
- And another, if you know what I mean
- And yet another
What I want to do is loop through the objectives, retaining the commas within the elements. I've been struggling with this for days. I want to avoid having to write some replace method in JS if I can help it.
Thanks!
How I'm looping:
<cfset values = ListToArray(#FORM['objectives']#)>
<cfloop index="i" list="#FORM['objectives']#">
x=#i#<br />
</cfloop>