1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1355 Views |
-
css + form

29 December 2008 at 11:10am
hi
how to add css to input type ?
i have to use addExtraClass() but how to add it to this code ?$fields = new FieldSet(
new TextField('FirstName', 'First name'),
new EmailField('Email', 'Email addres'),
); -
Re: css + form

29 December 2008 at 12:50pm
You need to store the object in a variable to run a method on it.
$text = new TextField('FirstName', 'First name');
$text->addExtraClass('foo');$fields = new FieldSet(
$text,
new EmailField('Email', 'Email addres'),
); -
Re: css + form

31 December 2008 at 7:56am
great
i have another problem
how to add title to <input type> ?
$firstname = new TextField(
$name = "FirstName",
$title = "this field is required",
$value = "your name"
);doesn't work :/
-
Re: css + form

9 February 2009 at 1:16pm Last edited: 9 February 2009 1:31pm
$firstname = new TextField(
$name = "FirstName",
$title = "this field is required",
$value = "your name"
);I'm not exactly an expert, but maybe the extra "$firstname" breaks some sort of behaviour when you are trying to add the title?
If you say...
new TextField(
$name = "FirstName",
$title = "this field is required",
$value = "your name"
);does that work any better?
| 1355 Views | ||
|
Page:
1
|
Go to Top |


