Why process forms with jQuery?
We use forms on the web to get input from our users. Sometimes we send that input to a server to save it, and sometimes we just do something interesting with it in the browser. We often use jQuery to help us process that form, either before sending to a server, or replacing the need for a server entirely.
We can use jQuery to do form "validation" - checking that inputs are the correct format, like the right phone number or length - and then send it off to a server. We do form validation in a few places on the Khan Academy settings page:
Screenshot of modifying the username on the settings page and getting an error about invalid characters
We can also use jQuery to create an in-browser quiz or game, like the exercises we have on Khan Academy:
Screenshot of selecting the right answer and seeing that it's correct
You'll use the same techniques for both of those sort of uses, and that's what we'll go through now. If you need a review of HTML forms first, go through these slides.
Note: Due to a browser bug, form processing won't work in IE 11 in our Khan Academy webpage environment. Please use a different browser if you're currently in IE 11.
Want to join the conversation?
- I can't hear anything - am I supposed to? I also clicked on "go through these sllides to review" and there is only one page that is not helpful.(3 votes)
- On the slides, try the arrow keys on your keyboard or scroll wheel on your mouse to go through them.(11 votes)
- The slides are somewhat hard to understand without a bit more explanation.(4 votes)
- Is anyone here really still using Internet Explorer?(2 votes)
9.4%of the population uses Internet Explorer.(4 votes)
- How can you process forms? (get the person's information)(3 votes)
- You can use a server-side language like php to do that.
- What is IE 11?(3 votes)
- Internet Explorer, version 11. I think it's the default browser for Windows.(1 vote)
- I don't know what I am supposed to do when going thru these slides for review.(2 votes)
- You can read through the slides using the mouse scroll or arrow keys.(2 votes)
- Does this mean we could make our own quizzes? Just like the ones everywhere else?(2 votes)
- Yes you can! That's actually a cool idea for a project.(2 votes)
- What is IE 11? Is it like a computer?(1 vote)
- IE usually refers to Mircosoft's web browser, the "Internet Explorer". I don't do Windows, but my understanding that IE has been replaced by "Edge", an equally annoying browser.(2 votes)