I need assistance with creating a script that can output the values from an array (obtained from a form) without displaying the variable names. Additionally, I want to include customized text before each value such as "You pledged $ (value they entered), Your name is (value they entered), etc." The challenge lies in achieving the second part of my requirement. It's currently better than having "myfunkyvariablename=value" displayed, but simply printing the values doesn't provide all the necessary information to the user. Is there a solution for this dilemma?
<script type="text/javascript>
/* <![CDATA[ */
var formData = location.search;
formData = formData.substring(1, formData.length);
while (formData.indexOf("+") != -1) {
formData = formData.replace("+", " ");
}
formData = unescape(formData);
var formArray = formData.split("&");
for (var i=0; i < formArray.length; ++i) {
var printBegin=formArray[i].search("=") +1
document.write(formArray[i].substring(printBegin) + "<br />");
}
/* ]]> */
</script>
If anyone could provide assistance on this matter, it would be greatly appreciated.