Welcome Guest, Not a member yet? Register   Sign In
New Helpers on the Wiki
#3

[eluser]skattabrain[/eluser]
Jim, this is driving me crazy (although it could have been the beers i had at lunch), I can't figure out why your CC validation helper wont validate my data.

I'm jsut trying to validate the cc number at this point. The other form fields not included below all validate.

1 - I took your code form the wiki - http://codeigniter.com/wiki/Credit_Card_Helper/ - and saved it into a file called ccval_helper.php and placed in into my application/helper directory

2 - the form in my view looks like this ...
Code:
$form1 .= form_label('Name On Card', 'ccname');
$form1 .= form_input('ccname');
$form1 .= form_label('Card Number', 'bccnumber');
$form1 .= form_input('ccnumber', $this->validation->ccnumber);
$form1 .= form_label('Expiration Month', 'ccmon');
$form1 .= form_input('ccmon');
$form1 .= form_label('Expiration Year', 'ccyear');
$form1 .= form_input('ccyear');
$form1 .= form_label('CVV', 'cccvv');
$form1 .= form_input('cccvv');

3 - my controller ...
Code:
$rules['ccnumber'] = "trim|required|callback_card_number_valid";
$this->validation->set_rules($rules);

$fields['ccnumber'] = 'Credit Card';        
$this->validation->set_message('card_number_valid', 'Invalid Credit Card Number');
$this->validation->set_fields($fields);

This won't validate, any idea what I'm doing wrong? Thanks.


Messages In This Thread
New Helpers on the Wiki - by El Forum - 08-27-2007, 01:31 AM
New Helpers on the Wiki - by El Forum - 08-27-2007, 04:48 AM
New Helpers on the Wiki - by El Forum - 06-13-2008, 03:02 PM
New Helpers on the Wiki - by El Forum - 07-02-2008, 12:03 PM
New Helpers on the Wiki - by El Forum - 07-02-2008, 03:47 PM
New Helpers on the Wiki - by El Forum - 10-27-2008, 05:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB