New Helpers on the Wiki |
[eluser]Jim OHalloran[/eluser]
Hi there! Just thought I'd let everyone know that my I've posted two of my helper modules to the CI Wiki. There's a Credit Card helper which makes some common credit card oprtations a little easier, and an Australian Date helper which has a few functions to make working with Australian formatted dates (d/m/y) a little easier. Hope someone else finds them as useful as I do. Jim.
[eluser]Unknown[/eluser]
Thanks Jim, I'll take a look ! I just posted a new helper on the wiki, so I think it is the good place to introduce it ![]() It is a BBCode helper, it can actually : - parse/remove bbcode - generate an array of bbcode buttons that can be clicked to be inserted - generate a javascript function needed to insert bbcodes into a form field - read config/bbcode.php to get the bbcodes Its code is mainly inspired by the smiley helper, so it works the same way. You can refer to the smiley helper guide if you don't know how to use it.
[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'); 3 - my controller ... Code: $rules['ccnumber'] = "trim|required|callback_card_number_valid"; This won't validate, any idea what I'm doing wrong? Thanks.
[eluser]maicobreako[/eluser]
I've been scratchin' my head all day, 'cause I also can't get this to work. I've been using the user guide validation form to try out a couple of things. The only thing that works as far as cc number goes, is if the field is left blank. Otherwise, anything and everything validates. I also tried another, very similar function that didn't work either. BTW, the truncate_card function is working on output to formsuccess.php, proving the helper is available to the class. Am I just overlooking something obvious regarding ci???? Any advice would be much appreciated. << Oh yeah, ci 1.6.2, php5.2.6 >> Controller: form.php: Code: <?php View: myform.php Code: <html> I've also tried altering the card_number_valid function as follows: Code: <?php
[eluser]skattabrain[/eluser]
a cc validation helper in the core would rock ... i think it's a common task that web developers face often.
[eluser]bretticus[/eluser]
Apparently, this has to be a controller function or method. I wrote a wrapper function in my controller to get around it: Code: <?php I suppose if somebody wants to call http://url.tld/controller/check_card/4111111111111111 they are welcome too ![]() Also, don't forget to define the error message: Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |