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

Offline shahiran12395

  • Jr. Member
  • **
  • Posts: 50
  • Karma: +3/-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: 1786
  • Karma: +250/-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