Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2011
    Thanked 0 Times in 0 Posts

    Exclamation Fetch info without reloading page (when clicking submit button - AJAX?)

    Coding-gurus, Need some serious help.

    If you guys take a look at:

    There is a field called "Personnummer". Fill this with:
    Then press "Hämta personuppgifter"

    It will then fetch/recieve some personal data and fill the correct fields.

    But.. as you can see.
    The number disappear when the site reloads, but the info fills in which is good at least. So how do I solve this? The number have to stay in the "Personnummer" field without reloading the whole page and still fill in the info.

    PHP Code:
    form action="index.php" method="post">
    div class="input text">
    label for="DataNum">Personnummer</label>
    input type="text" name="personnr" id="data" value=""/>

    input type="submit" id="GetData" value="Hämta personuppgifter" /> 

    Thats how the Personnummer (civic number) field and Hämta personuppgifter (get personal data) looks like.

    Hmm hope you guys know how to fix this.. Please write it all simply. Im probably the no1 newbie in here.

    Thanks in advance!!


    ps. Would be awesome if You (hope its not too much to request) could post what to add where etc. Since Im a total noob at this.. Thanks. Really appreciate the help!!!

  2. #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Saskatoon, Saskatchewan
    Thanked 2,668 Times in 2,637 Posts
    This has nothing to do with PHP. If you can execute the PHP script with the proper input and receive the proper output, then there is no problem here. Doing it in the background is all client side.
    Moving from PHP forum to AJAX forum.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


Posting Permissions

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