How to pass form values to another page. javascript

I have a form with allot of form items on it that posts to itself. I am trying to pass those form values to another page with out using the action attribute in the form. Is there a way to do this? I have tried jquery and javascript but coming up blank. Just trying to pass all the values at one time to another page. Seems a little difficult to me since im a intermediate javascript programmer. Any ideas are welcome and thank you in advance if someone knows how to get this going.

Here is what i am trying to do script wise.

theform is the ID of the form. I have a switch statement that is based on the button pressed would get into that statement. So if one of the three buttons on the page is “excel report” it should get into that statement and pass the values of the form to another page.

I have tried this:

<cfswitch expression="#LCase(Trim(FORM.submit))#">
	   <cfcase value="Excel Report">
		   	<script>
		   		function formSubmit() {
					var form = document.forms.theForm;
					// change the url
					form.action ="index.cfm?keyword=Report PDF New";
					form.submit();
						}
                     </script>
          </cfcase>
</cfswitch>

AND This

<cfswitch expression="#LCase(Trim(FORM.submit))#">
          <cfcase value="PDF Report">
		<script>
			$('##submit').click(function(){
				open('',"results");
				with(document.print)
				{
				method = "POST";
				action = "index.cfm?keyword=Report PDF New";
				target = "results";
				submit();
				}
				});
		</script>
	   </cfcase>
</cfswitch>

neither work.

Very little of cold fusion is known of here, but the typical way of achieving your end result is to use hidden form controls within the form itself, to store the data you wish to pass on.

Thanks for your reply I greatly appreciate it , but what I am looking for is the javascript that would enable me to pass variable on to the next page. I some what did it with the following script but dont know if its write or not. here is a peak.

<script language="javascript">
	function sendFormExcel(form){
		var sel = form.ToLB;
		for ( var i = 0; i < sel.options.length; ++i )
		{
			 sel.options[i].selected = true;
			}
		if ( document.theForm.ToLB.value == "" )
		{
		  alert ( "Please select items from the list box. " );
		  return false;
		}
		document.theform.action = 'index.cfm?keyword=Contract Report Excel';
		return true;
	}
	</script>

What do you mean by “some what”? I won’t even ask about write or peak.

I was trying to pass the form data from the page to another page by using the dynamic form attribute and for some reason the prevoious script is not going to that page. What I meant by somewhat is that the previous script is what I am looking to do but its not redirecting to the other page. Am i doing something wrong in this script. I even tried it by ID.

<script language=“javascript”>
function sendFormpdf(form){
var sel = form.ToLB;
for ( var i = 0; i < sel.options.length; ++i )
{
sel.options[i].selected = true;
}
if ( document.theForm.ToLB.value == “” )
{
alert ( "Please select from the list box. ");
return false;
} document.getElementByID(theForm).action=“index.cfm?keyword=Contract Report PDF”;
}
</script>

OK so I fixed the script so that when someone submits a form it should redirect to the new page. Now my problem is another srcript that when someone selects too many list items it should validate. This is not working for some reason. In advance thanks to whoever helps me fix this I greatly appreciate it.

The Script:

<script language="javascript">
	function sendForm(form){
	var sel = form.ToLB;
	for ( var i = 0; i < sel.options.length; ++i ) 
	{
	sel.options[i].selected = true;
					}
	if ( document.theForm.ToLB.value == "" ) 
	{
	alert ( "Please select an item from the list box. " );
	return false;
	}
	if(!sel.options[i].selected.length <10){
	alert("Sorry! You can only select up to 10 list items for the html view!");
	return false;
	}
}
</script>