Welcome Guest, Not a member yet? Register   Sign In
jQuery with PHP
#1

[eluser]RedIgniter[/eluser]
Hello everyone,

I am trying to create a registration form like facebook has, where the user sees only one error field on the bottom, (for which I guess PHP if statements are nested and are checking for inputs 1 by 1). Anyways, how would I come across this, using jquery and PHP, where the page doesn't reload. I really need help with this, and don't got no idea where to start from. I was struggling on finding such scripts online last couple of days but didn't find anything useful, or anything that could have done implemented with CodeIgniter.

Thanks in advance, any help is appreciated.
#2

[eluser]sooner[/eluser]
you can use ajax with jquery..so that the page doesn't load...
#3

[eluser]RedIgniter[/eluser]
I know I can, how would I make it so when the user clicks signup the code will check in function signup() for validation errors and print them without refreshing?
#4

[eluser]chandrajatnika[/eluser]
you can use jQuery ajax form for convert your form into ajax process
http://jquery.malsup.com/form/

if you using ci then the script will be like this:
Code:
<html>
<head>
    [removed][removed]
    [removed][removed]

    [removed]
        // wait for the DOM to be loaded
        $(function() {
            // bind 'myForm' and provide a simple callback function
            $('#myForm').ajaxForm(function() {
                alert("Thank you for your comment!");
            });
        });
    [removed]
</head>
<?php
    $this->load->helper('form');
    echo form_open('controllerprocess',array('id'=>'myForm'));
?>
    Name: &lt;?php echo form_input('name'); ?&gt;<br />
    Comment: &lt;?php echo form_textarea('comment'); ?&gt;<br />
    &lt;?php echo form_submit('submit','Submit comment'); ?&gt;
&lt;?php
    echo form_close();
?&gt;
....
#5

[eluser]chandrajatnika[/eluser]
whoa... I can't write any script tag in this forum, so you have to see the original link to get a clue.




Theme © iAndrew 2016 - Forum software by © MyBB