[Solved] Tooltip not show when form error codeigniter |
When I submit my form if there is a error on title i am trying to be able to trigger the tooltip.
Small part of the view below. PHP Code: <div class="form-group"> How ever does not seem to pick up the if (form_error('title')) {} on the controller. I have autoload the form_helper. I can see the validation messages when I use echo validation_error(); Question how can I make sure when there is a form_error it will run the tooltip. PHP Code: <?php
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
u can use form_error('title') which shows error message. but first u need to add rule in form_validation->set_rule(..); to be able to see from_error() message.
u can also add delimiters $this->form_validation->set_error_delimiters('<div class="input-error">', '</div>'); and then select by $('.input-error') to check if there is error u can use <?php if (from_error('title') != '') {?>
(03-10-2017, 08:33 AM)neuron Wrote: u can use form_error('title') which shows error message. but first u need to add rule in form_validation->set_rule(..); to be able to see from_error() message. Did not help what I am wanting to do with tooltip
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
I have now solved it
On script I have had to use .tooltip('show') like PHP Code: $(function () { And on controller Change the form error around PHP Code: public function index() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |