Set field value with javascript
===

    var field = document.getElementById("scheme");
	
	   if(location.search == "?scheme=1"){
	  	  field.value = "yes";
	   } else {
		  field.value = "no";
	   }

       <input type="hidden" name="scheme" id="scheme" value="">

The value of the field does not change, I tried alerting something to see if the code works and it does, just cant seem to change that fields value.