|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
passing array in hidden var
<cfoutput>
<cfloop collection="#session.cart#" item="i"> <cfset name="#session.cart[2]#"> <input type="hidden" name="name" value="#name#"> </cfloop> currently I use the field to send to another page, but only prints once. <cfoutput> #name# </cfoutput> I think I need a cfloop or for loop but not sure how to implement |
|
#2
|
|||
|
|||
|
One option is to dynamically name each hidden form field. Right now all of your form fileds would be named "name" which will screw things up.
Another option is to translate the array into XML using the CFWDDX tag, and then pass the WDDX-formatted string in the hidden form field. Then on the next page you can use CFWDDX again to translate the XML back into an array. |
|
#3
|
|||
|
|||
|
You may also need to further format the WDDX using the ToBase64() function since the WDDX packet may not pass properly in a hidden form field.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > passing array in hidden var |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|