News:

AbanteCart v1.4.2 is released.

Main Menu
support

add new required form field

Started by shahiran12395, August 08, 2019, 03:20:58 AM

Previous topic - Next topic

shahiran12395

Hi, im trying to add new required form field for guest checkout. But the field still can be blank without value. how can i appear error message like email field?

here is my code

if (isset($_post['nric'])){
            $nric = $_post['nric'];
        } elseif (isset($_session['guest']['nric'])){
            $nric = $_session['guest']['nric'];
        } else{
            $nric = '';
        }
        $this->data['form']['fields']['general']['nric'] = $form->getFieldHtml(
            array (
                'type'  => 'input',
                'name'  => 'nric',
                'value' => $nric,
                'required' => true,
            ));

abolabo

try to use $_session name in uppercase.
$_SESSION or use our wrapper $this->session->data[]
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

Forum Rules Code of conduct
AbanteCart.com 2010 -