2 different values from 1 selectbox?

I’m trying to send data to 2 different functions using the same selectbox. 1 function only needs a “ID” as value like this:

<select name="ccountry" onchange="getState(this.value)">
	<option value="1">USA</option>
    <option value="2">England</option>

The other one needs an url like this:

<select id="ajaxmenu" onChange="ajaxcombo('ajaxmenu', 'contentarea')">
	<option value="ajax.php?page=country&amp;code=1">USA</option>
    <option value="ajax.php?page=country&amp;code=1">England</option>

I have an idea, but not sure how to do it… If I use the last example and then somehow in my javascript function would be able to, like in php, extract the code=1 so I would get only the “1”…

Is there any way to do so?

Yes, you would have to do some simple string manipulation within your ajaxcombo function. The way you have it set up at the moment, your ajaxcombo is just receiving two static strings. You also need it to receive this.value like your first function (so a third argument). Then extract the code number from the string, using a regular expression or one of the string functions.

Well, trying to leave the ajaxcombo as is, but trying to extract the “code=1” part from the string like this:

var URL = "ajax.php?page=country&amp;code=1";
var d = URL.lastIndexOf("code");
var newURL = URL.substring(d);
alert (newURL);

But… Gives me to problems:
The alert comes out like this: “code=1”, and all I want is the “1”, and what if I have a urlstring like this:

var URL = "ajax.php?page=country&amp;code=1&id=15";

and I only want the “code” value…

Any ideas?