Ya lo tengo!
Al final debe ser así:
Código PHP:
function InputText(nombre,tamanyo,longitud,alineacion,deshabilitado){
var HTMLCode = "";
HTMLCode += "<input type ='text'";
HTMLCode += " style ='text-align:" + alineacion+ "'";
HTMLCode += deshabilitado;
HTMLCode += " id ='" + nombre + "'";
HTMLCode += " name ='" + nombre + "'";
HTMLCode += " size ='" + tamanyo + "'";
HTMLCode += " maxlength ='" + longitud + "'>";
document.write(HTMLCode);
}
Para crear una caja deshabilitada:
Código PHP:
<script>InputText("dni","8","8","left","disabled")</script>
Para crear una caja habilitada:
Código PHP:
<script>InputText("dni","8","8","left","")</script>