Ciao a tutti,
come posso impostare l'attributo readonly a delle textbox?
Ho fatto in questo modo:
function ChangeCliente()
{
var rbClienteNew = document.getElementById("rbClienteNew");
var rbClienteOld = document.getElementById("rbClienteOld");
if (rbClienteNew.checked==true)
{
AttivaCliente('yes');
}
else
{
AttivaCliente('no');
document.getElementById("ddlClienti").readOnly = 'yes';
}
}
function AttivaCliente(stato)
{
ragione_sociale = document.getElementById("txtRagioneSociale");
partita_iva = document.getElementById("txtPartitaIva");
codice_fiscale = document.getElementById("txtCodiceFiscale");
indirizzo = document.getElementById("txtIndirizzo");
citta = document.getElementById("txtCitta");
cap = document.getElementById("txtCap");
provincia = document.getElementById("txtProvincia");
stato = document.getElementById("txtStato");
ragione_sociale.readOnly = stato;
partita_iva.readOnly = stato;
codice_fiscale.readOnly = stato;
indirizzo.readOnly = stato;
citta.readOnly = stato;
cap.readOnly = stato;
provincia.readOnly = stato;
stato.readOnly = stato;
}
Rieco ad impostare readonly, ma non riesco a toglierla. Perchè?
Come posso disattivare una dropdownlist?
Grazie mille