jQuery Tutorials: Submitting a Form with AJAX

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2024

ความคิดเห็น • 199

  • @Knards
    @Knards 8 ปีที่แล้ว +3

    I have been using this method for several years, and totally forgot where I got it. I will make the necessary notations on the script to remind myself it was you

  • @aljodewi
    @aljodewi 11 ปีที่แล้ว

    I actually made something similair a week ago and I used serialize to make it work with different kind of forms. I made a lightbox which could include any form and send any form without being sent to another page. It's awesome!

  • @JosephMorse
    @JosephMorse 11 ปีที่แล้ว

    $.Post / $.Get are just helper functions that ultimately access the ajax method. So your basically doing the same thing, only using a helper function to do so. Also there are other methods that can be done with Ajax such as 'put' and 'delete'

  • @runenroll
    @runenroll 10 ปีที่แล้ว

    SO helpful!
    Especially as you are one of the very few presenters on TH-cam that don't sound like 10 year old kids or lisp.

  • @dominik1023
    @dominik1023 9 ปีที่แล้ว

    You have this really cool way of making the toothy and hairy mythical beast of Ajax appear very tame. Thank you profusely.

  • @LyleCrumbstorm
    @LyleCrumbstorm 3 ปีที่แล้ว

    I mean this in a totally straight way - I love you.

  • @benghabili9144
    @benghabili9144 10 ปีที่แล้ว

    I enjoy every lesson by Alex. Thanks Alex

  • @AnthonyVipond
    @AnthonyVipond 11 ปีที่แล้ว

    That is true, but Alex doesn't use global variables in this video. He's using the var keywords inside of a factory function, which is going to create variables local to the function

  • @tomholland8831
    @tomholland8831 11 ปีที่แล้ว

    Hi Alex, thanks a bunch for this tutorial. It helped me get my first ajax form working! However, it did not work for me exactly as you said. I got to the point of returning the $_POST data just fine, but the jQuery was not grabbing the form and I kept getting sent to my script. After a little digging around I fixed the problem by changing $('form.ajax').on('submit', function()) to $('form.ajax').submit(function())
    Thanks again!

  • @DannyMaller
    @DannyMaller 10 ปีที่แล้ว +5

    Great tutorial, as always with your videos. Variable naming could be better though. That = this and this references the variable that. $Name = name... I understood the session, but keeping that in mind for the future would be much smoother I think.

  • @jasonbikeracer1
    @jasonbikeracer1 9 ปีที่แล้ว

    This is a great video, thanks for not trying to do too much and making the video really long.

  • @life4christt
    @life4christt 9 ปีที่แล้ว +1

    Alex I couldn't ever grasp this until now, Thanks a million. Fix your site so I can give you money lol

  • @ShendiWijaya1337
    @ShendiWijaya1337 9 ปีที่แล้ว +1

    My Favorite Tutor! Thanks Sir

  • @alamgirkhan7285
    @alamgirkhan7285 8 ปีที่แล้ว +3

    Great, but if we want to include input type=file in the same form then how can we handle that just like the other ?

    • @alamgirkhan7285
      @alamgirkhan7285 7 ปีที่แล้ว +1

      Sir if you have the same problem then i have solved that i can help you

  • @camilocamargo98
    @camilocamargo98 5 ปีที่แล้ว

    the best explanation of this topic that i have ever seen, thanks man!!!.

  • @CzajekTutorialowiec
    @CzajekTutorialowiec 11 ปีที่แล้ว

    Hi Alex! I got question: Why aren't you using Notepad++ anymore, because personally I don't like this black background in this program you are using now.
    Greetings
    - Darek
    P.S. Great tut.

  • @ontwowheels9457
    @ontwowheels9457 6 ปีที่แล้ว +1

    instead of an array you can use form.serialize() function right?

  • @lukeschollmeyer8811
    @lukeschollmeyer8811 8 ปีที่แล้ว

    Very nice. Got me over a noobie issue I was having. Thanks for the clear tutorial.

  • @SamiullahKhan
    @SamiullahKhan 9 ปีที่แล้ว +1

    Hey Alex! I have question, disabled JavaScript take me directly to contact.php. I wanted to display an output message but wanted to be stay on same page?

  • @jwbonnett
    @jwbonnett 11 ปีที่แล้ว

    You maybe adding the script tags in the head or adding them before the form, you need to add the script after the form for it to be-able to pass the variables.

  • @dcsava
    @dcsava 11 ปีที่แล้ว

    nice and clean, any chance of a follow up showing the best way to validate fields with this method?

  • @RollingHousesUK
    @RollingHousesUK 11 ปีที่แล้ว

    if you have the code working as it does in the video, I think the next step would be to have JS rewrite part of the page with the relevant information, eg errors if there are errors in the form data, or your success message if all is good.
    I have no idea how to do that either (my JS knowledge is zero) but that's the next step and that's what I'm after also

  • @nitram_nosnibor
    @nitram_nosnibor 9 ปีที่แล้ว

    Excellent Alex cheers, this was extremely useful. I couldn't get it working for ages at first, but then realised that I forgot the parentheses off the .val() aagghhh. I just got a fully populated object instead of the expected JSON data - d'oh! Anyhoo, cheers mate. Oh and yes Ray below is right about checkboxes, mad eh!

  • @OlalekanElesin
    @OlalekanElesin 10 ปีที่แล้ว

    Thanks for this wonderful tutorial. worked perfectly for CodeIgniter

    • @Razvanh29
      @Razvanh29 6 ปีที่แล้ว

      I'm a CodeIgniter fan too. Can you share your code? (Only that part that regards inserting data through AJAX forms. Is there a Github account?) Thanks!

  • @kasminnicko474
    @kasminnicko474 11 ปีที่แล้ว

    Yes I agree, dark background not makes my eyes getting tired.

  • @DanielValenzuela
    @DanielValenzuela 7 ปีที่แล้ว

    The Best tutorial in the world !! Thank you so much !!

  • @JamesB00n
    @JamesB00n 11 ปีที่แล้ว

    I have a problem. I connected this to a Java Servlet which is writing the input values into a database. without ajax/jquery it works, but with ajax the values are written into the database 3times ...

  • @grislicezar1952
    @grislicezar1952 10 ปีที่แล้ว +1

    how can i display the content which was written when i hit a display button ?

  • @peterkallgren
    @peterkallgren 11 ปีที่แล้ว

    Great tutorial, but for checkboxes it will always return the value whether or not the checkbox is checked it seems.

  • @ATSPARIStransfers
    @ATSPARIStransfers 7 ปีที่แล้ว

    oh lawd !! This is amazing, mate ! legend !
    Thanks so much !!!!
    ps. I've been a subscriber since forever

  • @MoussaHarajli
    @MoussaHarajli 11 ปีที่แล้ว

    great tutorial! I learned new things here! I would always just add an id to each field and process it that way but i will always use this method!

  • @iammasoodalam
    @iammasoodalam 3 ปีที่แล้ว

    Thank you! It make my code easy to read.

  • @luciangx7529
    @luciangx7529 11 ปีที่แล้ว

    Hi Alex please tell me what is the extension for viewing array values inside the console that you use ?

  • @vidvibes27
    @vidvibes27 11 ปีที่แล้ว

    i think serialize() function is a better option for sending data through ajax

  • @omarmakled
    @omarmakled 11 ปีที่แล้ว

    Thank you , you are my favorite instructor

  • @Wiejeben
    @Wiejeben 11 ปีที่แล้ว

    Thank you! This seems like a great solution. But about for the people who have JS disabled. If you only want it to return a message, or a code, how do you make it so that for the people without the JS the form is still shown and not just a message that appeared?

  • @TheRoxas13th
    @TheRoxas13th 11 ปีที่แล้ว

    Uhh, why the name attribute is surrounded by square brackets? Can we just type name?

  • @homeproduced
    @homeproduced 11 ปีที่แล้ว

    let me be clear. i am having problem writing the code that will insert into news_reply table by matching the news reply with the related news!

  • @ripmusikuk
    @ripmusikuk 11 ปีที่แล้ว

    So if I wanted their name to appear on the form page after they have submitted I would have to call back the array to index.html or in my case index.php.

  • @wilsoncristiano4247
    @wilsoncristiano4247 7 ปีที่แล้ว +4

    Why you didn't use the .serialize() instead? I guess you could have saved time and lines. And great tutorial! ;D

    • @idHawk
      @idHawk 4 ปีที่แล้ว

      he could use that, but it's nice that he shows how to loop through all input (name) elements and get the values

  • @5310254
    @5310254 11 ปีที่แล้ว

    Hi Alex, I am new to programming whats the difference between jQuery and JavaScript?
    Thanks...

  • @JamesAutoDude
    @JamesAutoDude 11 ปีที่แล้ว

    For some reason, the "return false" doesnt work... And instead, I get shown the array. Kinda lame :/

  • @ashleyclarke7522
    @ashleyclarke7522 11 ปีที่แล้ว

    Javascript is the language whereas jquery is a js library, so jquery has a lot of helper functions to make your life easier.

  • @vidvibes27
    @vidvibes27 11 ปีที่แล้ว

    i have one more query what if the form action is on the same page(e.g form action="index.php") is it possible for ajax request on the same page or for every form create a new page.....

  • @mikekaperys24
    @mikekaperys24 11 ปีที่แล้ว

    So, I've got all that working. I want to be able to refresh the page (the page is a list of users, the form adds a new user) so the new user is displayed on the page, then show a confirmation message. How would I go about doing this?
    I've tried using location.reload(); before the confirmation but reloading the page cancels the confirmation.
    Thanks in advance

  • @AlexWohlbruck
    @AlexWohlbruck 8 ปีที่แล้ว

    Is there a benefit to using a loop to get the form data versus using jQuery serialize?

  • @janekkowalski1416
    @janekkowalski1416 5 ปีที่แล้ว

    Hi Alex, just a quick question. I heard you saying "you can do whatever you want with hat data". Well, I just want to send an email - how do I do that? Sorry, I'm so confused. I tried to make this work with the traditional way of sneding an email but it doesn't seem to be working.

  • @Soundmaster91
    @Soundmaster91 11 ปีที่แล้ว

    Hi Alex, me and a group of mates have been struggling with this for some time now, looked everywhere and tried everything. We've re-created your html example and its not doing what we require, which is to "not refresh" or "re-direct" to the server's page. We want the user to stay on the same page. Any help would be great. Thanks

  • @skotner
    @skotner 11 ปีที่แล้ว

    Yeah, would like to hear more on how to build further on this. Especially error handling.

    • @johndoe-jb
      @johndoe-jb ปีที่แล้ว

      like the success you have to put a property
      //////////////////////////////////////////
      error : function(response){
      console.log(response)
      }

  • @aaamjnho
    @aaamjnho 11 ปีที่แล้ว

    Helo Alex. I have a question. How to create form upload with type "file"?

  • @rockstar60631
    @rockstar60631 10 ปีที่แล้ว +3

    Had to wrap a document.ready function around it..

  • @krishnapatel6821
    @krishnapatel6821 3 หลายเดือนก่อน

    for some reason I need "$(document).ready()" above the form.ajax line at 7:07 for "trigger" to show up in the console

  • @Darth_Pro_x
    @Darth_Pro_x 4 ปีที่แล้ว

    can you do it without the php? just front-end and Ajax?

  • @jetfire2124
    @jetfire2124 8 ปีที่แล้ว +1

    Thank you! Great tutorial and very helpful!

  • @homeproduced
    @homeproduced 11 ปีที่แล้ว

    Alex, i have a question. i created a wall page where users can post news. i use a while loop to echo every row from the news table. however, i echo a textarea under ever news where users can comment on the news.. i am having problem doing this. can you help?
    i didn't know how else to contact you. thanks! love your videos btw!

  • @raylawlor4887
    @raylawlor4887 10 ปีที่แล้ว +2

    "Great tutorial, but for checkboxes it will always return the value whether or not the checkbox is checked it seems."
    I saw this comment below and I'm having this problem... is there any way to overcome it?

    • @raylawlor4887
      @raylawlor4887 10 ปีที่แล้ว

      I wrote a fix for this issue of anyone else has had it:
      After the first "find" function add this:
      that.find('input[type=radio]:checked').each(function(index, value){
      var that = jQuery(this);
      var name = that.attr('name');
      var value = that.val();
      data[name] = value;
      });
      We basically re-use the "find" function only this time we are trying to find checked radios.
      Then the "data[name]" is overwritten from the first "find" function and reset to whatever was checked.
      Hope this helps someone.

    • @raylawlor4887
      @raylawlor4887 10 ปีที่แล้ว

      Ray Lawlor
      This obviously DOESN'T work for checkboxes...
      Is there anyway to make this work for checkboxes?

    • @raylawlor4887
      @raylawlor4887 10 ปีที่แล้ว

      Ray Lawlor
      Ok so here's my checkbox fix:
      that.find('input[type=checkbox]:not(:checked)').each(function(index, value){
      var that = jQuery(this);
      var name = that.attr('name');
      var value = 'OFF';
      data[name] = value;
      });
      Again, all we're doing is finding which checkboxes are NOT checked and setting the value to "OFF"... The unchecked boxes will still be processed in the script, but they'll be marked as OFF.

    • @nitram_nosnibor
      @nitram_nosnibor 9 ปีที่แล้ว +1

      Ray Lawlor EXCELLENT Ray, thanks for sharing this bit of code to pick up the unchecked checkboxes. Strange that the ajax call doesn't work eh. Cheers buddy.

    • @raylawlor4887
      @raylawlor4887 9 ปีที่แล้ว

      Martin Robinson You're most welcome... glad it could help you! :)

  • @codingcat9052
    @codingcat9052 2 ปีที่แล้ว

    does this work with input names in multidimensional array like:
    input name="car[1][color]" value="red"
    input name="car[1][brand]" value="toyota"
    ...

  • @hongkongrubbish
    @hongkongrubbish 11 ปีที่แล้ว

    Why dont you use the 'serialize' in jquery?

  • @hamzaelbaz2002
    @hamzaelbaz2002 11 ปีที่แล้ว

    good but why you don't use serialization ?

  • @jakeinthetube
    @jakeinthetube 10 ปีที่แล้ว

    Excellent video!

  • @4sky
    @4sky 11 ปีที่แล้ว

    yea im wondering about this too.. how do you submit a form to a page without going to that page

  • @zero_cool
    @zero_cool 8 ปีที่แล้ว +3

    Great tutorial. The "index" and "value" parameters in the anonymous function weren't necessary and, instead, they could be a bit confusing for beginners because you later define a "value" variable.

    • @lighterinthestorm
      @lighterinthestorm 8 ปีที่แล้ว

      Donovan Peralta Just stfu and appreciate what you get.

    • @zero_cool
      @zero_cool 8 ปีที่แล้ว +2

      Lighter In The Storm, sounds like you have a foul mouth, don't you? How am I not appreciating the tutorial? If I'm not mistaken, I said the tutorial is great.

    • @lighterinthestorm
      @lighterinthestorm 8 ปีที่แล้ว

      Donovan Peralta just stfu.

    • @user-sp8eb6iz7f
      @user-sp8eb6iz7f 5 ปีที่แล้ว +3

      @@lighterinthestorm asshole in the storm

  • @pyroblazer68
    @pyroblazer68 7 ปีที่แล้ว

    Hi Mate,
    Great tutorial, I got this working on one of my forms a few months ago.
    Now I'm creating another form and I'm facing problem with 1 specific aspect. Dynamically added input fields.
    So I have a form and there is 1 input which has the option to "Add more" fields. The name of the existing and newly generated field is name="name[]". I've found(from other tutorials), that this is how it's done.
    When I post through conventional method, I get all the data in the 'action' page. It comes up as an array within the array $_POST.
    But when I do it through AJAX using your method. Somehow the values are getting over written, even though it does store it as an array with in the array $_POST. There's only 1 value in it at index[0], and this value is the of the last dynamically generated input field.
    Other functions such as add new field and remove field are working properly.
    I know this is not the best place to paste code, but I cant get a working jsfiddle.
    So, here's My Code:
    jQuery:
    =====
    $(document).ready(function() {
    "use strict";
    /*=====================================
    Add and Remove New Feilds To "ADD CLIENT" Form
    =====================================*/
    var i=1;
    $('#addSC').click(function() {
    i++;
    $('.secondaryContactList').append('Remove');
    console.log("New Field Created with List Item ID:row_"+i);
    });
    $(document).on('click', '.btn_remove', function(){
    //alert('hi');
    var btn_id=$(this).attr("id");
    console.log("Field removed with List Item ID : row_"+btn_id);
    $('#row_'+btn_id+'').remove();
    i--;
    });
    /*=====================================*/
    /*=====================================
    Submitting "ADD CLIENT" Form Using AJAX
    =====================================*/
    $('form#addClient').on('submit', function(){
    console.log('Submitting');
    var that=$(this),
    url=that.attr('action'),
    method=that.attr('method'),
    data={};
    that.find('[name]').each(function(){
    var that=$(this),
    name=that.attr('name'),
    value=that.val();
    console.log('Name : '+name+'
    Value :'+value+'

    ');
    data[name]=value;
    });
    console.log(data);
    /*$.ajax({
    url:url,
    type: method,
    data:data,
    success: function(response)
    {
    console.log(response);
    }
    });*/
    return false;
    });
    HTML:
    =====
    Add A Client
    Company Name *
    Primary Contact *

    Secondary Contact



    Add More Secondary Contacts
    PHP:
    ====
    calls.php
    ---------------
    require('functions.php');
    if(isset($_POST['addClientSubmit']))
    {
    add_client();
    }
    functions.php
    ----------------------
    function add_client()
    {
    print_r($_POST);
    }
    Hope you can help!
    Thanks In advance.
    Regards,
    Bhavil

  • @MohammedHesain
    @MohammedHesain 11 ปีที่แล้ว

    awesome tutorial buddy, but i think you should include something that tells the user "your form has been submitted"

  • @jesusvelarde3137
    @jesusvelarde3137 8 ปีที่แล้ว

    Absolutely amazing tutorial. Please keep up the good work.

  • @nithyanandhanmani9282
    @nithyanandhanmani9282 4 ปีที่แล้ว

    Can i bundle of snippets in php that reuse in projects. What cost of snippets

  • @mixalisbizimis9912
    @mixalisbizimis9912 6 ปีที่แล้ว

    Doesn't work for me!! Browser still is redirected to the form's action URI!

  • @RollingHousesUK
    @RollingHousesUK 11 ปีที่แล้ว

    do you mean as in phpacademy/tutorials/ajaxform/ ? as in with no index dot php? if that's what you mean, it's .htaccess url rewriting, most likely as implemented by a framework such as laravelle , code ignitor etc.

  • @johndoe-jb
    @johndoe-jb ปีที่แล้ว

    perfectly explained. thanks

  • @12345777ramil
    @12345777ramil 7 ปีที่แล้ว

    Thanks for the lessons, they are very helpful !

  • @Rembala
    @Rembala 11 ปีที่แล้ว

    What is the name of the program where you are writing code ?

  • @arthurhisao1953
    @arthurhisao1953 3 ปีที่แล้ว

    Thank you, Great tutorial!

  • @apollooverland
    @apollooverland 4 ปีที่แล้ว

    No idea why, but every single time I hit submit, the page forwards to the contact.php page. The data being sent is correct, but I don't see the point if the page forwards instead of simply showing the newly updated info on the original page :( anyone know why this is happening?

  • @xJochim
    @xJochim 11 ปีที่แล้ว

    How do you get your urls to look so neat?

  • @nizamuddienti3845
    @nizamuddienti3845 4 ปีที่แล้ว

    Wonderful video. Can you make video on how to show success message modal after submit form using ajax and php. Thank you

  • @moudirsd1376
    @moudirsd1376 11 ปีที่แล้ว

    What is the name of that editor ? how can i install it on windows ?

  • @mikefl
    @mikefl 8 ปีที่แล้ว

    You are brilliant!!! Thanks you very much!!!

  • @Razvanh29
    @Razvanh29 8 ปีที่แล้ว

    Is there an URL that the AJAX part can be downloaded from?

  • @omdevobhava
    @omdevobhava 6 ปีที่แล้ว

    Nice videos, Always helped me lots. Will you can create multiple fields value in one form (Like: text field, checkbox fields, image upload/multiple image upload) how to insert and edit all their values into database by using "AJAX".
    Kindly do it for us. Thank you very much.

  • @jimkella
    @jimkella 11 ปีที่แล้ว

    What text editor are you using instead?

  • @XKuzirashi
    @XKuzirashi 11 ปีที่แล้ว

    I would love if you could make tutorials about JS basics.

  • @boolowmp
    @boolowmp 11 ปีที่แล้ว

    Very impressive and easy
    Please can u tell how to save image file using ur code

  • @MoussaHarajli
    @MoussaHarajli 11 ปีที่แล้ว

    i heard it wasnt good to use global variables. Is that true?

  • @Razvanh29
    @Razvanh29 6 ปีที่แล้ว

    I did not find this tutorial on codecourse.com

  • @Rogerdatter
    @Rogerdatter 9 ปีที่แล้ว

    This doesent check if checkboxes are checked, it just sends the values anyway. I have a few input text fields and a few checkboxes. Also, if i use the same name for the checkboxes. Should i add an if :checked statement inside the find function or handle the checkboxes differently afterwards?

    • @shanKirs10
      @shanKirs10 8 ปีที่แล้ว

      +Rogerdatter
      Use this as a selector and you should be fine.
      'input[type=text], select, textarea, input[type=radio]:checked, input[type=checkbox]:checked'

  • @satishnaidup
    @satishnaidup 11 ปีที่แล้ว

    Great! I learned a lot from this video thanks...

  • @nikey646
    @nikey646 11 ปีที่แล้ว

    Haha it's sorta ironic, i learned how to do this based on your code in the URL Shortener, but this way is a lot harder and i don't really understand the concept of using $.Ajax, when you have $.Post/$.Get which are a lot easier to do.

  • @nobytes2
    @nobytes2 7 ปีที่แล้ว

    Good tutorial, as a programmer it was a bit strange using that for this. A better variable name would definitely be object or just obj, never seen anyone use that and that is a bad variable name in my opinion since I've used "this" in java as well. Nevertheless good tutorial!

  • @artemis1634
    @artemis1634 2 ปีที่แล้ว

    You are awesome, thanks for tutorial

  • @peterm.souzajr.2112
    @peterm.souzajr.2112 10 ปีที่แล้ว

    how can i do all three fields, but each one has its own submit button and the button only applies to and updated its corresponding input field? so three seperate and independant and not one which loops through all three at once?

    • @9308323
      @9308323 9 ปีที่แล้ว

      For loop

  • @art3mix69
    @art3mix69 9 ปีที่แล้ว

    after seeing +Ray Lawlor comment, i wanted to post my solution to the checkbox value problem.
    if you want to get the checkbox value (the way its done now, you are getting the value of a checkbox no matter if its checked or not) you can use below 'if' after you set (data[name] = value;) :
    if(name == 'gender'){
    data[name] = $('input[name=gender]:checked', '#ajax').val();
    }
    gender = my name attribute of the checkboxes (for make and female),
    #ajax = id of my form.
    the above way will give you the value of the checked checkbox, and nothing if none of the checkboxes are checked (under the same name attribute you gave - mine is 'gender')

    • @shanKirs10
      @shanKirs10 8 ปีที่แล้ว

      +Yan Mayatski
      This maybe a better solution to the checkbox issue.
      Use this string in the jQuery select statement instead:
      'input[type=text], select, textarea, input[type=radio]:checked, input[type=checkbox]:checked'

  • @hfeldadna
    @hfeldadna 7 ปีที่แล้ว

    One of the best tutorials !
    well explained
    Thank you very much

  • @bra5081
    @bra5081 9 ปีที่แล้ว

    Thank you. very good tutorial. Also learnt a couple of things about PHP and jQuery in the process :p

  • @praveenpatel1989
    @praveenpatel1989 8 ปีที่แล้ว

    Thanks Alex, This helped a lot..

  • @cupsaalex3728
    @cupsaalex3728 9 ปีที่แล้ว

    Is this an asynchronous method of comunicating with the server ??

  • @Arthurbn
    @Arthurbn 10 ปีที่แล้ว +6

    Thank you for this video. I have replicated the steps, but for some reason when I submit the form, instead of sending the data behind the scenes, the browser loads the PHP page. I specified "return false;" (6:53), but it does not work.

    • @dovonic13
      @dovonic13 6 ปีที่แล้ว +1

      damndamn four years late:P well if anyone else is having this issue its because your javascript is broken. Im debuggin right now and when i write something wrong it sends to the php page. thats because js stops when it runs into an error so the "return false" at the bottom of the script is never read.

    • @keysgsgkey4587
      @keysgsgkey4587 5 ปีที่แล้ว +2

      @@dovonic13 are you sure thats it? I have no errors with my javascript and it still redirects me to the action

    • @dovonic13
      @dovonic13 5 ปีที่แล้ว

      keySG SGkey once my code ran it ran clean:P couple things off the top of my head...if your using a $.getScript() to import a script than that may cause the console to be a lil funky...if nothing from your code runs at all before the page redirect, then its probably broken, maybe put an alert(“itworked”) and thatll show you if it actually ran....if it did than maybe you put the “return false” in the ajax callback function and not the on submit function...its all a guess unless you have a lil code pen or something😛😛😛😛😛

    • @webdevanjali
      @webdevanjali 5 ปีที่แล้ว

      exactly it's redirecting me to the php page :/

    • @dovonic13
      @dovonic13 5 ปีที่แล้ว

      Anjali your code broke before it ran the return false

  • @bryana5214
    @bryana5214 10 ปีที่แล้ว

    Thank you so much :) good explanation thus makes me easier to understand.

  • @jonaspalmiano2102
    @jonaspalmiano2102 4 ปีที่แล้ว

    Thank you!

  • @mishalrai1879
    @mishalrai1879 9 ปีที่แล้ว

    it is very useful to me thank you alex

  • @renegaed
    @renegaed 11 ปีที่แล้ว

    thanks for your tutorial. I think serialize() is actually much easier. consider this: data = that.serialize();