Welcome Guest, Not a member yet? Register   Sign In
CODEIGNITER ROOKIE
#1

[eluser]djjonex[/eluser]
Hello everyone, I'm trying to make a register form and I would like to check if the username is available... I know thats AJAX... I know that I can create a button that calls a javascript function.... the script read the input, send to the PHP code(db query), and receive the answer to display in a <div>....

The thing I don't know is how to do it in CodeIgniter .... If somebody wants to help me with the sintax or give me some examples ... I'll appreciate...

Thank!
#2

[eluser]Cro_Crx[/eluser]
Before you create a checker in AJAX, it's probably best to try one in just plain PHP and then once you get that concept then create an AJAX one.

You'll need to create a callback function for your form validation class. Here's the link http://ellislab.com/codeigniter/user-gui...#callbacks

Let me know if your still stuck, I can post some code snippets if you'd like.
#3

[eluser]djjonex[/eluser]
Yeah Lab Assistan, thanks for tying to help me. I understand that validation class. So ... what's next?
#4

[eluser]xzela[/eluser]
[quote author="Cro_Crx" date="1248474684"]
You'll need to create a callback function for your form validation class. Here's the link http://ellislab.com/codeigniter/user-gui...#callbacks
[/quote]

I think the form validation uses a form submit. Plus, the callback is only ran once a form has been submitted, which really isn't ajax.

You may want to read up on jQuery or script.aculo.us. They have some examples you can try in normal PHP. But Cro_Crx is right, you'll need to get the idea down before implementing it in CodeIgniter
#5

[eluser]djjonex[/eluser]
Ok I understand a litle bit of JQUERY.... but where exactly in the host I have to place the .js ...... using code igniter
#6

[eluser]Tyler Diaz[/eluser]
I recommend following this tutorial for the jQuery : http://jqueryfordesigners.com/using-ajax...ate-forms/

If you get too stumped on how to use your JS file or so, post back.




Theme © iAndrew 2016 - Forum software by © MyBB