I don't know if we are talking about the same thing, but I'll give it a shot.
Do you mean that when the form is processed, the value is only the first name? If so, then the problem is that you didn't surround your value with "
value= $revnamebyid
if revnamebyid has any spaces in it, your form will only take the first portion.
eg: if revnamebyid = "john doe" then the form will be printed as:
<option value=john doe>john doe</option> The displayed name is fine because it is within open and close tags, however the value will break because there are not quotes around it to tell the form that "doe" is not just another parameter like name, value, etc.
it should read:
value=\" $revnamebyid\" if revnamebyid is ever more than just one word.