CRUD Module Development
CRUD Module Development
Sample Code
Sample Code
In its simplest form, the drupal_get_form() function takes a callback function and uses the results of that function to create a form structure and then manage handling of the resulting form. In the above example, it will return an HTMrmatted form. While the drupal_get_form() function only makes use of one argumentthe name of the callback functionit can take more arguments. Any additional arguments will simply be passed on to the functions that it calls
Sample Code
); function student($arg1){ $form=array(); $genderarray=array('Male'=>'Male','Female'=>'Female'); $form['studentform']= array( '#type' => 'fieldset', '#title' => t('Adding of Student'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['studentform']['studentid'] = array( '#title' => t('Student ID'), '#size' => 9, '#maxlengh' => 25, '#required'=>TRUE, '#default_value'=>$studid, '#type' =>'textfield',
Cont.
Objective is to:
Add fields for School Year,Semester,Major, Year Level and College Add student record in the database.
ICT Center
We are making IT happen
Integrity
Commitment
Teamwork