Tank Auth value, set_value, and form validation issue

418 Views Asked by At

I'm using Tank Auth (it's working fine), but I can't get the form validation function to work when I include any value in the variable array along with set_value. I need these values as a label for form fields--they tells the user what to enter in the field.

How can I keep Tank Auth's form validation functionality AND use a value in the value field?

$login = array(
    'name'  => 'login',
    'id'    => 'login',
    'value' => set_value('login', 'Enter username'),
);
1

There are 1 best solutions below

2
On BEST ANSWER

this populates field values : set_value('field_name');

this shows individual errors: form_errors('field_name');

If you use html5, you can simply add a placeholder!

{ placeholders should not be used as an alternative to labels!}

$login = array(
    'name'  => 'login',
    'id'    => 'login',
    'value' => set_value('login'),
    'placeholder' => 'Enter Username',
    'required' => 'required'
);