1

I am validating my Custom Admin form on the server side. In the model, on _beforeSave() I throw an exception if there is something wrong with a specific field.

Now, the point is that the error from the exception is catched in the save of the controller :

    try {
    ...
        } catch (Exception $e) {
                                    Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                                    Mage::getSingleton('adminhtml/session')->setFormData($data);

$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
                                    return;
                                }

and will be displayed on the top of the page (addError), how can I put some kind of focus on the field that should be fixed? Anything that can be done without using Javascript?

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.