Welcome Guest, Not a member yet? Register   Sign In
Validate Drop Down Selections
#11

[eluser]Petsoukos[/eluser]
[quote author="iConTM" date="1283386876"]Does the link to your css file work?
Try view source and copy paste the css link in your browser.[/quote]

Yes it spits out the script...
#12

[eluser]iConTM[/eluser]
Ah maybe it's the version of jquery?

I used jquery-1.3.2.min.js

I noticed that some jquery plugins only work with a certain version of jquery installed.
#13

[eluser]Petsoukos[/eluser]
I have the latest in use.
#14

[eluser]iConTM[/eluser]
try using jquery-1.3.2.min.js
#15

[eluser]Petsoukos[/eluser]
Well I mixed up the datepicker utilities. Actually I've used this http://javascriptcalendar.org/javascript...picker.php this was causing the problem I've mentioned.

The one you are referring is working. You said the textfield+datepicker is more userfriendly. One click only. But I think otherwise. With this date picker I have to click 25 times to get to my year of birth + 1 to select the date. ;-)
#16

[eluser]Petsoukos[/eluser]
Hm... I've got it running with drop down and it validates correctly as far I can tell.

I check the validation from on point only
Code:
$this->form_validation->set_rules('year', 'Year', 'trim|required|numeric|callback_datechecker');
$this->form_validation->set_rules('month', 'Month', 'trim|required|numeric');
$this->form_validation->set_rules('day', 'Day', 'trim|required|numeric');
The form validation on the year input.

The callback method:
Code:
function DateChecker() {
$y = $this->input->post('year');
$m = $this->input->post('month');
$d = $this->input->post('day');
    if(checkdate($m, $d, $y)) {            
        return true;
    } else {
        $this->form_validation->set_message('datechecker', 'Invalid Date!');
        return false;
    }
}

Can someone else confirm this? When for example I enter an erroneous date like 2010 02 31 (31 Feb ;-P ) I get the error message. Or any invalid date. If someone was so kind to review it for any loopholes or a trick to bypass it I would be greatfull.

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB