I'm trying to set a textfield readonly.
I see in the documentation that I can set a TextField to readonly, however how is this implemented?
I have a custom form, but where do I put the readonly part for the field I want to make readonly?
function Form() {
return new Form($this, "Form", new FieldSet(
// List your fields here
new EmailField("Email", "Email address"),
new PasswordField("Password", "Password"),
new TextField("FirstName", "First name"),
new TextField("LastName", "Last name"),
new TextField("Phone", "Phone"),
new TextField("Company", "Company/Hospital"),
new TextField("Address1", "Address 1"),
new TextField("Address2", "Address 2"),
new TextField("City", "City"),
new TextField("State", "State"),
new TextField("Zip", "Zip"),
new TextField("Country", "Country"),
new TextField("IPAdress","IPAddress",$_SERVER['REMOTE_ADDR'])
), new FieldSet(
// List the action buttons here
new FormAction("SignupAction", "Register")
), new RequiredFields(
// List the required fields here: "Email", "FirstName"
"Email", "Password", "FirstName", "LastName", "Phone", "Company", "Address1", "City", "State", "Zip", "Country"
));
}