php - Add widgets in forms -
Hello, I want to know that it is possible to add a widget to the CRUD form: I want to select an entry in a list or If the entry is not in the list to enter text in the input.
The user selects in the list or writes in the input, then the user selects with the radio button.
Is this possible? If yes, how can I do this?
I'm not completely sure if I understand your question correctly.
If you want to add a field to your autogenerated form, then you can simply modify the "XxxxForm" class which resides in /lib/forms/XxxxForm.class.php. You can add a radio button by adding the following code:
Configure Public Function () {parent: Configure (); $ This- & gt; Widgetskima ['myfield'] = new sfWidgetFormInputCheckbox (); $ This- & gt; Valid chem ['myfield'] = new sfValidatorBoolean (array ('required' => true)); }
I hope it helps.
Comments
Post a Comment