Since you are extracting value, and will have to use JavascriptExecutor anyways, then it is far simpler to just use JavascriptExecutor to extract the value in 1 step than to enable with javascript then extract value with WebDriver API in 2 steps. Here's how you could do it:
String theTextIWant = ((JavascriptExecutor) driver).executeScript("return arguments[0].value;",driver.findElement(By.id("ref")));
You just use javascript to extract out the value attribute of the input field. If it were a div or textarea, then you'd like use the innerHTML, innerText, or textContent attributes (the latter may be best).
If you just did want to enable only, it'd probably be something like this, assuming you just need to set some fields to false. If you have to remove (readlonly and disabled) attributes that's a little different. Not sure how to do that, you can search online for the javascript for that and follow example below to figure out how to do that.
//you might also need to change class value to something like "form_fields" without the "_readonly" assuming such a non-read-only class exists
((JavascriptExecutor) driver).executeScript("arguments[0].readonly = false; arguments[0].disabled = false;",driver.findElement(By.id("ref")));