Author Topic: add new required form field  (Read 56 times)

Offline shahiran12395

  • Newbie
  • *
  • Posts: 43
  • Karma: +1/-0
    • View Profile
add new required form field
« on: August 08, 2019, 03:20:58 AM »
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

Code: [Select]
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,
            ));

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1781
  • Karma: +247/-11
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: add new required form field
« Reply #1 on: August 08, 2019, 03:40:23 AM »
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

 

Powered by SMFPacks Social Login Mod