// Get the value of a text field called "name" $nameField = $form->getElement('name'); $nameValue = $nameField->getValue(); echo "Name: " . $nameValue;
// Get the value of a select field called "gender" $genderField = $form->getElement('gender'); $genderValue = $genderField->getValue(); if ($genderValue == 'male') { echo 'Male'; } else { echo 'Female'; }In this example, we retrieve the value of a select field called "gender" and then check if the value is "male" or "female". We then display the appropriate text based on the value of the field. The Varien_Data_Form_Element_Abstract class is part of the Magento Framework package library.