Hello guys

see if you can help me with this strange problem:
I have the following javascript function:

function changeNumberOfItems() {
var form = document.forms[0];
var totalNumberOfItems = form.numItems.value;
alert("\"" + totalNumberOfItems + "\"");
totalNumberOfItems = totalNumberOfItems.replace(/^\s+/,"");
totalNumberOfItems = totalNumberOfItems.replace(/\s+$/,"");
alert("\"" + totalNumberOfItems + "\"");
form.action = "browsing.php?page=1&itemsPerPage=25&numItems=" + totalNumberOfItems;

The value that I obtain from a form element (the bold one) comes from a textfield. I trim all whitespaces from around its value and the second alert shows me that indeed whitespaces have been removed.

The last alert shows me the URL encoding that the browser will request.
However, when the function executes, the actual URL that is displayed in the browser has an addtional + sign before the totalNumberOfItems value.
For example: instead of browsing.php?page=1&itemsPerPage=25&numItems=7
The URL in the address bar reads: browsing.php?page=1&itemsPerPage=25&numItems=+7

Does anyone know what I am doing wrong?