Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Getting Feedback

    I used this code from phpacademy but i cant seem to get it to work, i'm new to javascript, i'm more on the php and css side of coding. So is there an error of some sort?

    This is the regular page:
    Code:
    <head>
    <script type="text/javascript">
    $(document).ready(function() {
    $('#getthis').load('checkinfo.php').show();
    $('#username').keyup(function() {
    $.post('checkinfo.php', { username: form.username.value },
    function(result) {
    $('#getthis').html(result).show();
    }); 
    }); 
    });
    </script>
    </head>
    <body>
    
    <form  method='post'>
    Username: <input type='text' name='username' id='username' size='30' maxlength='25'> <div id='getthis'> </div>
    </form>
    
    </body>
    and this is the checkinfo.php:
    Code:
    <?php
    echo "$username = $_POST['username'];"
    ?>
    Last edited by j_robert_r; 05-14-2011 at 12:20 AM.

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    well, looks like you are trying to use jQuery. Issue is, you are not linking to jQuery in your HTML.

    http://docs.jquery.com/Downloading_jQuery
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #3
    New Coder
    Join Date
    Aug 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks, that worked, i also found out why it wasn't working in addition to what you said.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •