CodeIgniter Forums

Full Version: Need Urgent but Perfect help in jQuery and CI Integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3

El Forum

[eluser]Mizanur Islam Laskar[/eluser]
Hi, I'm new in CI. I need to integrate jQuery in CI (including remote script funtions for AJAX) for my current 2 projects. Can any expert help me with a proper and complete code-snippets?

For example, I need to develope an exact thing like http://www.simplypost.ca/register_step1.php, which is created from the scratch, but I need to develope it in CI now. Play with the link to know my reqirements perfectly, like type [email protected] in the Email Address field and press TAB. Again type another email like [email protected] and pess TAB....yes, remote scripts are responsible there for that unique-validity checking. Also type both correct/incorrect digits in Captcha field, type password less than 6 char, etc.

I went through the existing wikis in this site, but nothing could not give me a solution. Plz, I'm really need this very badly....Thanks

El Forum

[eluser]xwero[/eluser]
Quote:proper and complete code-snippets

You are asking a developer to create an ajax form for you without any sign you tried to come up with your solution. Try putting this in the job board and put a price on your urgency.

El Forum

[eluser]Mizanur Islam Laskar[/eluser]
Sorry for the way of my requesting. Actually I'm too fustrated that I didn't get any way other than this for my emergency. Actually I already posted a thread on this : http://ellislab.com/forums/viewthread/83768/
There, I've illustrated my codes too (plz view my last code there), but failed to get any light on my target.
I think this will be a great help for other newbies like me who want to integrate jQuary in CI like me.....Thanks

El Forum

[eluser]xwero[/eluser]
In the other post you say you don't want to change the javascript but you are using php files to check the input remotely. these urls need to change to something like index.php/ajax/validation/email.

The tab keypress isn't the most userfriendly way to instantiate the validation as it will move the cursor a field down and if a users click on another field the validation will not happen until the user presses the submit button.

inparo gave you a good preset helping you out with the serverside code but i don't see how you want to integrate your previous code without changing your javascript code.

El Forum

[eluser]Mizanur Islam Laskar[/eluser]
Yes, imparo really tried his best to help me out there, but I gave up there in my thread because he told me to make my all ajax-related scripts to work for GET request, because of CI's speial security mechanism....


I've already applied that url, but seems you didn't see that in my another thread:
Code:
....
email: {
    required: true,
    email: true,
    remote: "http://localhost/projects/inbook/index.php/SignUp/confirm_email"
    },
....

Ok, forget about the TAB-related issue. I'll think about that later myself. Lets concentrate on this remote-scripting if you wish. BTB, I've also illustrated my controller funcion in that thread:

Code:
function confirm_email()
{
$email = $this->input->post('email');
$this->load->model('check_model');
$valid_email = $this->check_model->check_email($email);
echo ($valid_email == 0) ? 'false' : 'true';
}
But according to the CI manual, I also tried with
Code:
$this->input->post('email')
, but no improvement.

And here is my model function also:

Code:
function check_email($email)
{
$valid = 0;
$this->load->database();
$query=$this->db->getwhere('user_profile',array('user_email'=>$email));
$valid += $query->num_rows();
return $valid;
}

El Forum

[eluser]xwero[/eluser]
the validation plugin works with GET so your url will be http://localhost/projects/inbook/index.php/SignUp/[email protected] This means you can't use the input->post method. You have to use the input->get method. But this doesn't work without enabling query strings in your config.php file. And you need to change the uri_protocol setting to PATH_INFO because if it stays in the default auto protocol it eats up the key-value pair if there is only one, which is the case here.

El Forum

[eluser]Mizanur Islam Laskar[/eluser]
Did all as you suggested, but end-up with the same result. Means, wether an email address in in DB or not, it always says that "The email address is already in use"...Don't know whats going on

El Forum

[eluser]xwero[/eluser]
I don't know the validation plugin well enough to be sure but it can be you need to output in a certain format. Did the false/true output did the trick in your older code?

El Forum

[eluser]Mizanur Islam Laskar[/eluser]
Sure it did in http://www.simplypost.ca/register_step1.php
Plz open the link in Firefox and view all the internal/external JavaScript functionalities there

El Forum

[eluser]xwero[/eluser]
Try the link on it's own http://localhost/projects/inbook/index.php/SignUp/[email protected] to check the output.

First you need to pinpoint the moment something breaks before you can work out a solution and because you are working with server and client side code the points of breaking double.

If the url outputs the right text the problem lays with the validation plugin.
Pages: 1 2 3