[Javascript] submit form functions

Grinwald, Uri UGrinwald at dynamic.ca
Thu Oct 14 09:38:01 CDT 2004


Hi Guys.

I currently have a drop down list being populated by values from an
access database.
When the user selects an option two javascript functions are used on the
onChange event handler.
One that retrievs the value and the other that submits the form.

function getListValue(list){
	var listValue="";
	if (list.selectedIndex != -1) {
		listValue = list.options[list.selectedIndex].value;
		listValue = removeSpaces(listValue);
		}
	return (listValue);
}
function removeSpaces(string) {
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return string;
}

My problem is that the value is being passed as a URL variable which
means I am using the QueryString to obtain the value. This is being
displayed in the URL address bar so I tried changing the form to post
but that causes the functions to not work altogether. Is there a way of
maybe having the function pass the value as a hiidne field so that I can
use the Request.Form to obtain the value?

Thanks for your time.

Uri



More information about the Javascript mailing list